diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6c31c2ce629..745b1afc656 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -9,6 +9,7 @@ "packages/google-cloud-beyondcorp-clientgateways": "0.2.1", "packages/google-cloud-bigquery-analyticshub": "0.1.0", "packages/google-cloud-bigquery-datapolicies": "0.1.0", + "packages/google-cloud-bigquery-datatransfer": "3.1.3", "packages/google-cloud-gkemulticloud": "0.1.2", "packages/google-cloud-language": "5.1.0", "packages/google-cloud-oslogin": "4.0.2", diff --git a/packages/google-cloud-bigquery-datatransfer/.OwlBot.yaml b/packages/google-cloud-bigquery-datatransfer/.OwlBot.yaml new file mode 100644 index 00000000000..cd116fe219c --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.OwlBot.yaml @@ -0,0 +1,21 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/bigquery/datatransfer/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-bigquery-datatransfer/$1 + diff --git a/packages/google-cloud-bigquery-datatransfer/.eslintignore b/packages/google-cloud-bigquery-datatransfer/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-bigquery-datatransfer/.eslintrc.json b/packages/google-cloud-bigquery-datatransfer/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-bigquery-datatransfer/.gitattributes b/packages/google-cloud-bigquery-datatransfer/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-bigquery-datatransfer/.gitignore b/packages/google-cloud-bigquery-datatransfer/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-cloud-bigquery-datatransfer/.jsdoc.js b/packages/google-cloud-bigquery-datatransfer/.jsdoc.js new file mode 100644 index 00000000000..0996c76f575 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.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/bigquery-data-transfer', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-bigquery-datatransfer/.mocharc.js b/packages/google-cloud-bigquery-datatransfer/.mocharc.js new file mode 100644 index 00000000000..cdb7b752160 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-bigquery-datatransfer/.mocharc.json b/packages/google-cloud-bigquery-datatransfer/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-bigquery-datatransfer/.nycrc b/packages/google-cloud-bigquery-datatransfer/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-bigquery-datatransfer/.prettierignore b/packages/google-cloud-bigquery-datatransfer/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-bigquery-datatransfer/.prettierrc.js b/packages/google-cloud-bigquery-datatransfer/.prettierrc.js new file mode 100644 index 00000000000..d546a4ad546 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-bigquery-datatransfer/.repo-metadata.json b/packages/google-cloud-bigquery-datatransfer/.repo-metadata.json new file mode 100644 index 00000000000..d28eb8b234a --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "default_version": "v1", + "release_level": "stable", + "requires_billing": true, + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bigquery-data-transfer/latest", + "codeowner_team": "@googleapis/api-bigquery", + "language": "nodejs", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559654", + "product_documentation": "https://cloud.google.com/bigquery/transfer/", + "name": "bigquery-data-transfer", + "distribution_name": "@google-cloud/bigquery-data-transfer", + "name_pretty": "Google BigQuery Data Transfer Service", + "api_id": "bigquerydatatransfer.googleapis.com", + "repo": "googleapis/google-cloud-node", + "api_shortname": "bigquerydatatransfer", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-bigquery-datatransfer/CHANGELOG.md b/packages/google-cloud-bigquery-datatransfer/CHANGELOG.md new file mode 100644 index 00000000000..11c557879f2 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/CHANGELOG.md @@ -0,0 +1,435 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/bigquery-data-transfer?activeTab=versions + +## [3.1.3](https://github.com/googleapis/nodejs-bigquery-data-transfer/compare/v3.1.2...v3.1.3) (2022-09-22) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#566](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/566)) ([75603cc](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/75603cc30c64778a51aec8af92487d4ff32f7ef8)) + +## [3.1.2](https://github.com/googleapis/nodejs-bigquery-data-transfer/compare/v3.1.1...v3.1.2) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#564](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/564)) ([06d6789](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/06d678906f1e78a2c8e14ac02a5c190e35045f1c)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/1553)) ([#563](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/563)) ([7cba4dd](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/7cba4dd5e29e0d46fa64ee607a7172f1e5ab3fc3)) + +## [3.1.1](https://github.com/googleapis/nodejs-bigquery-data-transfer/compare/v3.1.0...v3.1.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#558](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/558)) ([14faf3b](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/14faf3bc851177c76550d042aa3da8fe47b55328)) +* change import long to require ([#559](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/559)) ([128b219](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/128b219fcf94bac10a1a4dc76c32dc525d92038e)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/1546)) ([#562](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/562)) ([f6e41bd](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/f6e41bd6dd4e4de8ebea1d6aca71264d05c9926b)) + +## [3.1.0](https://github.com/googleapis/nodejs-bigquery-data-transfer/compare/v3.0.0...v3.1.0) (2022-06-29) + + +### Features + +* support regapic LRO ([#550](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/550)) ([20e2d96](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/20e2d96389c9a49a40c1db7102bd2b0f3bef5c49)) + +## [3.0.0](https://github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.3.0...v3.0.0) (2022-05-17) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#545) + +### Features + +* add owner email to TransferConfig message feat: allow customer to enroll a datasource programmatically docs: improvements to various message and field descriptions ([#519](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/519)) ([028c61c](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/028c61c8488791371febc583fe2edf077a3a5052)) + + +### Build System + +* update library to use Node 12 ([#545](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/545)) ([6bfaefa](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/6bfaefa1148284ee986c36983cf3f5aaebb317ac)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.7...v2.3.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#490](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/490)) ([18eb020](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/18eb020441195ead30ccb867ab2c5cfc607fd1f2)) + +### [2.2.7](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.6...v2.2.7) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#487](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/487)) ([79fda9a](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/79fda9aa1a3eb5e840d299201fdc599314018d6c)) + +### [2.2.6](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.5...v2.2.6) (2021-08-11) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#485](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/485)) ([023c672](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/023c672f38514833a6c426705ad15100197b0f21)) + +### [2.2.5](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.4...v2.2.5) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#477](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/477)) ([aa0e611](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/aa0e6115e861006b6eabf0e58d3de8033d365918)) + +### [2.2.4](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.3...v2.2.4) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#475](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/475)) ([5039af0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/5039af0c7bef6acf9b5a2c3ca0a876cfa1ea90ce)) + +### [2.2.3](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.2...v2.2.3) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#472](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/472)) ([9f43f07](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/9f43f07aa530741ee7690d4dcc0c6d15023e7cb1)) + +### [2.2.2](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.1...v2.2.2) (2021-06-30) + + +### Bug Fixes + +* make request optional in all cases ([#467](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/467)) ([30a0585](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/30a05858eaff80ac57fc9b4d59c129750ee01082)) + +### [2.2.1](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.0...v2.2.1) (2021-06-07) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#450](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/450)) ([8872637](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/88726378bab4349b653160b9dfcda7ed142c87d9)) +* GoogleAdsError missing using generator version after 1.3.0 ([#460](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/460)) ([585f7d8](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/585f7d89b879faa9ae5127eb2b53c233c9ba1028)) +* use require() to load JSON protos ([#453](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/453)) ([ceae869](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/ceae8690c4d1b2b1edf7255f484d7885edc1dbf1)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.1.2...v2.2.0) (2021-01-09) + + +### Features + +* introduce style enumeration ([#422](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/422)) ([f07e2a0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/f07e2a07db04138d7bfe268915e9ca0b60f7a8f3)) + +### [2.1.2](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.1.1...v2.1.2) (2020-11-25) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#413](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/413)) ([c239061](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/c2390614214c4c0c95972f4400785deba0d15a22)) + +### [2.1.1](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.1.0...v2.1.1) (2020-07-09) + + +### Bug Fixes + +* typeo in nodejs .gitattribute ([#374](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/374)) ([f97cb56](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/f97cb56af111684f4c4f5d1a1da62decfdae5ea6)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.0.0...v2.1.0) (2020-06-15) + + +### Features + +* move ts target to es2018 from es2016 ([#363](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/363)) ([e731cd2](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/e731cd2875ab443565df5dd8af955a7618d8a35d)) + + +### Bug Fixes + +* proper fallback option handling ([e8ecb1d](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/e8ecb1dcf415d5576f64ee46989939fe61bfe860)) +* regen protos and unit test ([#358](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/358)) ([74010a6](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/74010a6961c23d1d5d162df5ac151402749d01b6)) +* remove eslint, update gax, fix generated protos, run the generator ([#344](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/344)) ([886c3da](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/886c3da12770a16f762f348195939ca5a37ead38)) +* synth clean for src/index ([#357](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/357)) ([458ea3a](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/458ea3a3e5adc964b5f695d8f68e3409a3f4d230)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.5.3...v2.0.0) (2020-04-10) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. +* move API to typescript code generation (#300) + +### Features + +* bump release level to GA ([#296](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/296)) ([8d1850a](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/8d1850ad542efb7d6f5ceac245f6e69c6f0550ed)) +* deferred client initialization ([#321](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/321)) ([dc667b3](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/dc667b31d22796946bf94a01ece0cb60d083049c)) +* drop node8 support, support for async iterators ([#335](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/335)) ([e9a9b24](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/e9a9b240159d9dd8e22e99bc733b5ff6a023b769)) +* export protos in src/index.ts ([7426c53](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/7426c53e19b040c60b2c12267eb494b5db90b32a)) +* move API to typescript code generation ([#300](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/300)) ([9094a74](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/9094a74364a8b1a19dff53926453d4a777d5fb21)) +* use first party client oauth ([b687434](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/b687434b6f11e8f3539cc07b7bd8c8234211286a)) + + +### Bug Fixes + +* export explicit version from protos.js ([#339](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/339)) ([5ed9ed0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/5ed9ed0117e697711098602a0c7270faa99eb9d5)) +* pass x-goog-request-params header for streaming calls ([1af9266](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/1af926661ef293b920849562a9106799b212d793)) + +### [1.5.3](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.5.2...v1.5.3) (2020-01-21) + + +### Bug Fixes + +* proto resource annotation removed, no code change ([9e0873f](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/9e0873f62f925e7dad871b0e96edc074e833d151)) + +### [1.5.2](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.5.1...v1.5.2) (2019-12-09) + + +### Bug Fixes + +* change resource type TransferRun to Run to be consistent with gapic configs ([993eb79](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/993eb79b7398720b7882006f96b54b21ba365217)) + +### [1.5.1](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.5.0...v1.5.1) (2019-12-05) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([9e22425](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/9e22425c970f92348cab350c9b5604d0a406220e)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.4.1...v1.5.0) (2019-11-13) + + +### Features + +* **docs:** bump release level to beta ([#268](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/268)) ([90f199b](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/90f199b479e850bdf13a7e9a83e2c353866ac854)) + + +### Bug Fixes + +* **docs:** snippets are now replaced in jsdoc comments ([#266](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/266)) ([cbe1699](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/cbe1699dcc26f000cb5456fd44c3259b596a84cb)) + +### [1.4.1](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.4.0...v1.4.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#261](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/261)) ([cefa817](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/cefa817cdab3dc2db527336408d971ede5541e2a)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.3.0...v1.4.0) (2019-10-08) + + +### Bug Fixes + +* use compatible version of google-gax ([0bacf46](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/0bacf46)) + + +### Features + +* support new proto field options ([#252](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/252)) ([261e075](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/261e075)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.5...v1.3.0) (2019-09-06) + + +### Features + +* load protos from JSON, grpc-fallback support ([86df420](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/86df420)) + +### [1.2.5](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.4...v1.2.5) (2019-08-26) + + +### Bug Fixes + +* populate correct version # in x-goog-api-client header ([937f1ac](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/937f1ac)) + +### [1.2.4](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.3...v1.2.4) (2019-08-08) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([8fd5422](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/8fd5422)) + +### [1.2.3](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.2...v1.2.3) (2019-07-16) + + +### Bug Fixes + +* update to the latest version of the service ([#232](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/232)) ([a08f503](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/a08f503)) + +### [1.2.2](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.1...v1.2.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#229](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/229)) ([2ec1152](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/2ec1152)) + +### [1.2.1](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.0...v1.2.1) (2019-06-14) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#225](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/225)) ([85726ce](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/85726ce)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.1.0...v1.2.0) (2019-06-07) + + +### Features + +* adds startManualTransferRuns, enableDataTransferService, and isDataTransferServiceEnabled methods ([4a45c8f](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/4a45c8f)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.0.0...v1.1.0) (2019-06-05) + + +### Features + +* support apiEndpoint override in client constructor ([#219](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/219)) ([c8e6ca0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/c8e6ca0)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v0.5.1...v1.0.0) (2019-05-20) + + +### ⚠ BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#194) + +### Bug Fixes + +* **deps:** update dependency google-gax to ^0.26.0 ([#192](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/192)) ([417634a](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/417634a)) +* DEADLINE_EXCEEDED is no longer retried ([fb87d7c](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/fb87d7c)) +* DEADLINE_EXCEEDED retry code is idempotent ([#203](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/203)) ([d0ff039](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/d0ff039)) +* **deps:** update dependency google-gax to v1 ([#202](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/202)) ([245cf09](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/245cf09)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#194](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/194)) ([39eca4f](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/39eca4f)) + +## v0.5.1 + +03-12-2019 13:53 PDT + +This patch release contains a few bug fixes, dependency updates, and doc improvements. Enjoy! + +### Bug Fixes +- fix: throw on invalid credentials ([#167](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/167)) +- fix: do not require projectId for samples ([#147](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/147)) + +### Dependencies +- fix(deps): update dependency google-gax to ^0.25.0 ([#158](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/158)) + +### Documentation +- docs: update comments on protos ([#172](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/172)) +- docs: update API doc comments ([#171](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/171)) +- docs: update links in contrib guide ([#169](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/169)) +- docs: update contributing path in README ([#164](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/164)) +- docs: move CONTRIBUTING.md to root ([#163](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/163)) +- docs: add lint/fix example to contributing guide ([#160](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/160)) + +### Internal / Testing Changes +- chore: update require statement code style +- build: Add docuploader credentials to node publish jobs ([#175](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/175)) +- build: use node10 to run samples-test, system-test etc ([#174](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/174)) +- build: update release configuration +- chore(deps): update dependency mocha to v6 +- build: use linkinator for docs test ([#168](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/168)) +- build: create docs test npm scripts ([#166](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/166)) +- build: test using @grpc/grpc-js in CI ([#165](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/165)) +- refactor: improve generated code style ([#162](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/162)) +- chore(deps): update dependency eslint-config-prettier to v4 ([#157](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/157)) +- chore: update the date in the copyright header. ([#156](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/156)) +- build(docs): ignore www.gstatic.com/bigquerydatatransfer link ([#152](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/152)) +- build: check broken links in generated docs ([#148](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/148)) +- nit: reordered message types + +## v0.5.0 + +12-21-2018 10:19 PST + +### Dependencies +- fix(deps): update dependency google-gax to ^0.22.0 ([#119](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/119)) +- refactor: remove unused deps ([#115](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/115)) +- chore(deps): update dependency through2 to v3 ([#113](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/113)) +- fix(deps): update dependency google-gax to ^0.20.0 ([#83](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/83)) +- fix(deps): update dependency google-gax to ^0.19.0 ([#73](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/73)) +- fix(deps): update dependency google-gax to ^0.18.0 ([#63](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/63)) + +### Documentation +- docs: update readme badges ([#130](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/130)) +- fix(samples): fix the sample and add a system test ([#127](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/127)) +- docs(samples): updated samples code to use async await ([#124](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/124)) + +### Internal / Testing Changes +- refactor: modernize the sample tests ([#144](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/144)) +- chore(build): inject yoshi automation key ([#143](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/143)) +- chore: update nyc and eslint configs ([#142](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/142)) +- chore: fix publish.sh permission +x ([#140](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/140)) +- fix(build): fix Kokoro release script ([#139](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/139)) +- build: add Kokoro configs for autorelease ([#138](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/138)) +- chore: always nyc report before calling codecov ([#135](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/135)) +- chore: nyc ignore build/test by default ([#134](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/134)) +- chore: update license file ([#132](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/132)) +- fix(build): fix system key decryption ([#128](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/128)) +- chore: add a synth.metadata +- chore: update eslintignore config ([#118](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/118)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#117](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/117)) +- chore: drop contributors from multiple places ([#116](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/116)) +- chore: use latest npm on Windows ([#114](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/114)) +- chore: update CircleCI config ([#112](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/112)) +- chore: include build in eslintignore ([#109](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/109)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#105](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/105)) +- chore: update issue templates ([#104](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/104)) +- chore: remove old issue template ([#102](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/102)) +- build: run tests on node11 ([#101](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/101)) +- chores(build): do not collect sponge.xml from windows builds ([#100](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/100)) +- chores(build): run codecov on continuous builds ([#99](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/99)) +- chore: update new issue template ([#98](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/98)) +- build: fix codecov uploading on Kokoro ([#95](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/95)) +- Update kokoro config ([#93](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/93)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#92](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/92)) +- test: remove appveyor config ([#89](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/89)) +- Update the CI config ([#88](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/88)) +- Enable prefer-const in the eslint config ([#86](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/86)) +- Enable no-var in eslint ([#85](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/85)) +- Switch to let/const ([#84](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/84)) +- Update CI config ([#82](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/82)) +- Add templating to synth and update CI ([#80](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/80)) +- Retry npm install in CI ([#79](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/79)) +- Re-generate library using /synth.py ([#76](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/76)) +- chore(deps): update dependency nyc to v13 ([#74](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/74)) +- chore(deps): update dependency eslint-config-prettier to v3 ([#72](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/72)) +- chore: do not use npm ci ([#71](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/71)) +- chore: ignore package-lock.json ([#68](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/68)) +- chore(deps): lock file maintenance ([#67](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/67)) +- chore(deps): lock file maintenance ([#66](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/66)) +- chore: update renovate config ([#65](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/65)) +- remove that whitespace ([#64](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/64)) +- chore(deps): lock file maintenance ([#62](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/62)) +- chore: move mocha options to mocha.opts ([#60](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/60)) +- chore: require node 8 for samples ([#61](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/61)) +- chore(deps): lock file maintenance ([#59](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/59)) +- chore(deps): update dependency eslint-plugin-node to v7 ([#56](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/56)) +- test: use strictEqual in tests ([#57](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/57)) +- chore(deps): lock file maintenance ([#55](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/55)) +- fix(deps): update dependency @google-cloud/bigquery-data-transfer to ^0.4.0 ([#54](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/54)) + +## v0.4.0 + +### Implementation Changes +- Re-generate library using /synth.py (#51) + - Interal proto changes (additional bindings) + - DEPRECATION: transfer_type field option has no effect + - See: https://github.com/googleapis/googleapis/compare/abe00527f...master + +#### BREAKING CHANGE +In this version we dropped support for NodeJS 4.x and 9.x. Your code might break if you're using this library on non LTS versions. +- fix: drop support for node.js 4.x and 9.x (#47) + +### Dependencies +- chore(deps): update dependency eslint to v5 (#44) +- chore(package): update nyc to version 12.0.2 (#35) +- fix: update all dependencies (#33) + +### Internal / Testing Changes +- refactor: drop repo-tool as an exec wrapper (#42) +- fix: update linking for samples (#39) +- Configure Renovate (#37) +- update gax and synth.py (#43) +- chore(build): use `npm ci` instead of `npm install` (#49) +- chore: the ultimate fix for repo-tools EPERM (#31) +- chore: timeout for system test (#30) +- chore: test on node10 (#28) +- chore: one more workaround for repo-tools EPERM (#26) +- chore: workaround for repo-tools EPERM (#25) +- chore: make samples depend on the current version (#24) +- chore: setup nighty build in CircleCI (#23) diff --git a/packages/google-cloud-bigquery-datatransfer/CODE_OF_CONDUCT.md b/packages/google-cloud-bigquery-datatransfer/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datatransfer/CONTRIBUTING.md b/packages/google-cloud-bigquery-datatransfer/CONTRIBUTING.md new file mode 100644 index 00000000000..e5fee50feb6 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google BigQuery Data Transfer Service 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=bigquerydatatransfer.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datatransfer/LICENSE b/packages/google-cloud-bigquery-datatransfer/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/google-cloud-bigquery-datatransfer/README.md b/packages/google-cloud-bigquery-datatransfer/README.md new file mode 100644 index 00000000000..5c3efbd1f3c --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/README.md @@ -0,0 +1,192 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google BigQuery Data Transfer Service: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![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/bigquery-data-transfer.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-data-transfer) + + + + +BigQuery Data Transfer API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Google BigQuery Data Transfer Service Node.js Client API Reference][client-docs] +* [Google BigQuery Data Transfer Service Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google BigQuery Data Transfer Service 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/bigquery-data-transfer +``` + + +### Using the client library + +```javascript +const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer'); +const client = new bigqueryDataTransfer.v1.DataTransferServiceClient(); + +async function quickstart() { + const projectId = await client.getProjectId(); + + // Iterate over all elements. + const formattedParent = client.projectPath(projectId, 'us-central1'); + let nextRequest = {parent: formattedParent}; + const options = {autoPaginate: false}; + console.log('Data sources:'); + do { + // Fetch the next page. + const responses = await client.listDataSources(nextRequest, options); + // The actual resources in a response. + const resources = responses[0]; + // The next request if the response shows that there are more responses. + nextRequest = responses[1]; + // The actual response object, if necessary. + // const rawResponse = responses[2]; + resources.forEach(resource => { + console.log(` ${resource.name}`); + }); + } while (nextRequest); + + console.log('\n\n'); + console.log('Sources via stream:'); + + client + .listDataSourcesStream({parent: formattedParent}) + .on('data', element => { + console.log(` ${element.name}`); + }); +} +quickstart(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Data_transfer_service.check_valid_creds | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js,samples/README.md) | +| Data_transfer_service.create_transfer_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js,samples/README.md) | +| Data_transfer_service.delete_transfer_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js,samples/README.md) | +| Data_transfer_service.delete_transfer_run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js,samples/README.md) | +| Data_transfer_service.enroll_data_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js,samples/README.md) | +| Data_transfer_service.get_data_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js,samples/README.md) | +| Data_transfer_service.get_transfer_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js,samples/README.md) | +| Data_transfer_service.get_transfer_run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js,samples/README.md) | +| Data_transfer_service.list_data_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js,samples/README.md) | +| Data_transfer_service.list_transfer_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js,samples/README.md) | +| Data_transfer_service.list_transfer_logs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js,samples/README.md) | +| Data_transfer_service.list_transfer_runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js,samples/README.md) | +| Data_transfer_service.schedule_transfer_runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js,samples/README.md) | +| Data_transfer_service.start_manual_transfer_runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js,samples/README.md) | +| Data_transfer_service.update_transfer_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/quickstart.js,samples/README.md) | +| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js,samples/README.md) | + + + +The [Google BigQuery Data Transfer Service 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/bigquery-data-transfer@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/bigquery-data-transfer/latest +[product-docs]: https://cloud.google.com/bigquery/transfer/ +[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=bigquerydatatransfer.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-bigquery-datatransfer/linkinator.config.json b/packages/google-cloud-bigquery-datatransfer/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-bigquery-datatransfer/package.json b/packages/google-cloud-bigquery-datatransfer/package.json new file mode 100644 index 00000000000..2eb940fc2f4 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/package.json @@ -0,0 +1,67 @@ +{ + "name": "@google-cloud/bigquery-data-transfer", + "description": "BigQuery Data Transfer API client for Node.js", + "version": "3.1.3", + "license": "Apache-2.0", + "author": "Google Inc", + "engines": { + "node": ">=12.0.0" + }, + "repository": "googleapis/nodejs-bigquery-data-transfer", + "main": "build/src/index.js", + "files": [ + "build/protos", + "build/src" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google bigquerydatatransfer", + "bigquerydatatransfer", + "BigQuery Data Transfer API" + ], + "scripts": { + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", + "docs": "jsdoc -c .jsdoc.js", + "lint": "gts check", + "fix": "gts fix", + "docs-test": "linkinator docs", + "predocs-test": "npm run docs", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.2", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datasource.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datasource.proto new file mode 100644 index 00000000000..d7400a55935 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datasource.proto @@ -0,0 +1,542 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.datatransfer.v1; + +import "google/api/annotations.proto"; +import "google/cloud/bigquery/datatransfer/v1/datatransfer.proto"; +import "google/cloud/bigquery/datatransfer/v1/transfer.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/api/client.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer"; +option java_multiple_files = true; +option java_outer_classname = "DataSourceProto"; +option java_package = "com.google.cloud.bigquery.datatransfer.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1"; + +// The Google BigQuery Data Transfer API allows BigQuery users to +// configure transfer of their data from other Google Products into BigQuery. +// This service exposes methods that should be used by data source backend. +service DataSourceService { + option (google.api.default_host) = "bigquerydatatransfer.googleapis.com"; + + // Update a transfer run. If successful, resets + // data_source.update_deadline_seconds timer. + rpc UpdateTransferRun(UpdateTransferRunRequest) returns (TransferRun) { + option (google.api.http) = { + patch: "/v1/{transfer_run.name=projects/*/locations/*/transferConfigs/*/runs/*}" + body: "transfer_run" + }; + } + + // Log messages for a transfer run. If successful (at least 1 message), resets + // data_source.update_deadline_seconds timer. + rpc LogTransferRunMessages(LogTransferRunMessagesRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}:logMessages" + body: "*" + }; + } + + // Notify the Data Transfer Service that data is ready for loading. + // The Data Transfer Service will start and monitor multiple BigQuery Load + // jobs for a transfer run. Monitored jobs will be automatically retried + // and produce log messages when starting and finishing a job. + // Can be called multiple times for the same transfer run. + rpc StartBigQueryJobs(StartBigQueryJobsRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}:startBigQueryJobs" + body: "*" + }; + } + + // Notify the Data Transfer Service that the data source is done processing + // the run. No more status updates or requests to start/monitor jobs will be + // accepted. The run will be finalized by the Data Transfer Service when all + // monitored jobs are completed. + // Does not need to be called if the run is set to FAILED. + rpc FinishRun(FinishRunRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}:finishRun" + body: "*" + }; + } + + // Creates a data source definition. Calling this method will automatically + // use your credentials to create the following Google Cloud resources in + // YOUR Google Cloud project. + // 1. OAuth client + // 2. Pub/Sub Topics and Subscriptions in each supported_location_ids. e.g., + // projects/{project_id}/{topics|subscriptions}/bigquerydatatransfer.{data_source_id}.{location_id}.run + // The field data_source.client_id should be left empty in the input request, + // as the API will create a new OAuth client on behalf of the caller. On the + // other hand data_source.scopes usually need to be set when there are OAuth + // scopes that need to be granted by end users. + // 3. We need a longer deadline due to the 60 seconds SLO from Pub/Sub admin + // Operations. This also applies to update and delete data source definition. + rpc CreateDataSourceDefinition(CreateDataSourceDefinitionRequest) returns (DataSourceDefinition) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/dataSourceDefinitions" + body: "data_source_definition" + }; + } + + // Updates an existing data source definition. If changing + // supported_location_ids, triggers same effects as mentioned in "Create a + // data source definition." + rpc UpdateDataSourceDefinition(UpdateDataSourceDefinitionRequest) returns (DataSourceDefinition) { + option (google.api.http) = { + patch: "/v1/{data_source_definition.name=projects/*/locations/*/dataSourceDefinitions/*}" + body: "data_source_definition" + }; + } + + // Deletes a data source definition, all of the transfer configs associated + // with this data source definition (if any) must be deleted first by the user + // in ALL regions, in order to delete the data source definition. + // This method is primarily meant for deleting data sources created during + // testing stage. + // If the data source is referenced by transfer configs in the region + // specified in the request URL, the method will fail immediately. If in the + // current region (e.g., US) it's not used by any transfer configs, but in + // another region (e.g., EU) it is, then although the method will succeed in + // region US, but it will fail when the deletion operation is replicated to + // region EU. And eventually, the system will replicate the data source + // definition back from EU to US, in order to bring all regions to + // consistency. The final effect is that the data source appears to be + // 'undeleted' in the US region. + rpc DeleteDataSourceDefinition(DeleteDataSourceDefinitionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dataSourceDefinitions/*}" + }; + } + + // Retrieves an existing data source definition. + rpc GetDataSourceDefinition(GetDataSourceDefinitionRequest) returns (DataSourceDefinition) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dataSourceDefinitions/*}" + }; + } + + // Lists supported data source definitions. + rpc ListDataSourceDefinitions(ListDataSourceDefinitionsRequest) returns (ListDataSourceDefinitionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dataSourceDefinitions" + }; + } +} + +// Describes data which should be imported. +message ImportedDataInfo { + // Defines schema of a field in the imported data. + message FieldSchema { + // LINT.IfChange + // Field type. + enum Type { + // Illegal value. + TYPE_UNSPECIFIED = 0; + + // 64K, UTF8. + STRING = 1; + + // 64-bit signed. + INTEGER = 2; + + // 64-bit IEEE floating point. + FLOAT = 3; + + // Aggregate type. + RECORD = 4; + + // 64K, Binary. + BYTES = 5; + + // 2-valued. + BOOLEAN = 6; + + // 64-bit signed usec since UTC epoch. + TIMESTAMP = 7; + + // Civil date - Year, Month, Day. + DATE = 8; + + // Civil time - Hour, Minute, Second, Microseconds. + TIME = 9; + + // Combination of civil date and civil time. + DATETIME = 10; + + // Numeric type with 38 decimal digits of precision and 9 decimal digits + // of scale. + NUMERIC = 11; + + // Geography object (go/googlesql_geography). + GEOGRAPHY = 12; + } + + // Field name. Matches: [A-Za-z_][A-Za-z_0-9]{0,127} + string field_name = 1; + + // Field type + Type type = 2; + + // Is field repeated. + bool is_repeated = 3; + + // Description for this field. + string description = 4; + + // Present iff type == RECORD. + RecordSchema schema = 5; + } + + // Describes schema of the data to be ingested. + message RecordSchema { + // One field per column in the record. + repeated FieldSchema fields = 1; + } + + // External table definition. These tables can be referenced with 'name' + // in the query and can be read just like any other table. + message TableDefinition { + // CSV specific options. + message CsvOptions { + // The delimiter. We currently restrict this to U+0001 to U+00FF and + // apply additional constraints during validation. + google.protobuf.StringValue field_delimiter = 1; + + // Whether CSV files are allowed to have quoted newlines. If quoted + // newlines are allowed, we can't split CSV files. + google.protobuf.BoolValue allow_quoted_newlines = 2; + + // The quote character. We currently restrict this to U+0000 to U+00FF + // and apply additional constraints during validation. Set to '\0' to + // indicate no quote is used. + google.protobuf.StringValue quote_char = 3; + + // Number of leading rows to skip. + google.protobuf.Int64Value skip_leading_rows = 4; + + // Accept rows that are missing trailing optional columns. + google.protobuf.BoolValue allow_jagged_rows = 5; + } + + // BigQuery table_id (required). This will be used to reference this + // table in the query. + string table_id = 1; + + // URIs for the data to be imported. All URIs must be from the same storage + // system. + repeated string source_uris = 2; + + // Describes the format of the data in source_uri. + Format format = 3; + + // Specify the maximum number of bad records that can be ignored. + // If bad records exceed this threshold the query is aborted. + int32 max_bad_records = 4; + + // Character encoding of the input when applicable (CSV, JSON). + // Defaults to UTF8. + Encoding encoding = 5; + + // CSV specific options. + CsvOptions csv_options = 6; + + // Optional schema for the data. When not specified for JSON and CSV formats + // we will try to detect it automatically. + RecordSchema schema = 7; + + // Indicates if extra values that are not represented in the table schema is + // allowed. + google.protobuf.BoolValue ignore_unknown_values = 10; + } + + // Data format. + enum Format { + // Unspecified format. In this case, we have to infer the format from the + // data source. + FORMAT_UNSPECIFIED = 0; + + // CSV format. + CSV = 1; + + // Newline-delimited JSON. + JSON = 2; + + // Avro format. See http://avro.apache.org . + AVRO = 3; + + // RecordIO. + RECORDIO = 4; + + // ColumnIO. + COLUMNIO = 5; + + // Capacitor. + CAPACITOR = 6; + + // Parquet format. See https://parquet.apache.org . + PARQUET = 7; + + // ORC format. See https://orc.apache.org . + ORC = 8; + } + + // Encoding of input data in CSV/JSON format. + enum Encoding { + // Default encoding (UTF8). + ENCODING_UNSPECIFIED = 0; + + // ISO_8859_1 encoding. + ISO_8859_1 = 1; + + // UTF8 encoding. + UTF8 = 2; + } + + // SQL query to run. When empty, API checks that there is only one + // table_def specified and loads this table. Only Standard SQL queries + // are accepted. Legacy SQL is not allowed. + string sql = 1; + + // Table where results should be written. + string destination_table_id = 2; + + // The description of a destination table. This can be several sentences + // or paragraphs describing the table contents in detail. + string destination_table_description = 10; + + // When used WITHOUT the "sql" parameter, describes the schema of the + // destination table. + // When used WITH the "sql" parameter, describes tables with data stored + // outside of BigQuery. + repeated TableDefinition table_defs = 3; + + // Inline code for User-defined function resources. + // Ignored when "sql" parameter is empty. + repeated string user_defined_functions = 4; + + // Specifies the action if the destination table already exists. + WriteDisposition write_disposition = 6; +} + +// A request to update a transfer run. +message UpdateTransferRunRequest { + // Run name must be set and correspond to an already existing run. Only + // state, error_status, and data_version fields will be updated. All other + // fields will be ignored. + TransferRun transfer_run = 1; + + // Required list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2; +} + +// A request to add transfer status messages to the run. +message LogTransferRunMessagesRequest { + // Name of the resource in the form: + // "projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}" + string name = 1; + + // Messages to append. + repeated TransferMessage transfer_messages = 2; +} + +// A request to start and monitor a BigQuery load job. +message StartBigQueryJobsRequest { + // Name of the resource in the form: + // "projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}" + string name = 1; + + // Import jobs which should be started and monitored. + repeated ImportedDataInfo imported_data = 2; + + // User credentials which should be used to start/monitor + // BigQuery jobs. If not specified, then jobs + // are started using data source service account credentials. + // This may be OAuth token or JWT token. + bytes user_credentials = 3; + + // The number of BQ Jobs that can run in parallel. + int32 max_parallelism = 8; +} + +// A request to finish a run. +message FinishRunRequest { + // Name of the resource in the form: + // "projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}" + string name = 1; +} + +// Represents the request of the CreateDataSourceDefinition method. +message CreateDataSourceDefinitionRequest { + // The BigQuery project id for which data source definition is associated. + // Must be in the form: `projects/{project_id}/locations/{location_id}` + string parent = 1; + + // Data source definition. + DataSourceDefinition data_source_definition = 2; +} + +// Represents the request of the UpdateDataSourceDefinition method. +message UpdateDataSourceDefinitionRequest { + // Data source definition. + DataSourceDefinition data_source_definition = 1; + + // Update field mask. + google.protobuf.FieldMask update_mask = 2; +} + +// Represents the request of the DeleteDataSourceDefinition method. All transfer +// configs associated with the data source must be deleted first, before the +// data source can be deleted. +message DeleteDataSourceDefinitionRequest { + // The field will contain name of the resource requested, for example: + // `projects/{project_id}/locations/{location_id}/dataSourceDefinitions/{data_source_id}` + string name = 1; +} + +// Represents the request of the GetDataSourceDefinition method. +message GetDataSourceDefinitionRequest { + // The field will contain name of the resource requested. + string name = 1; +} + +// Options for writing to the table. +// The WRITE_EMPTY option is intentionally excluded from the enum and is not +// supported by the data transfer service. +enum WriteDisposition { + // The default writeDispostion + WRITE_DISPOSITION_UNSPECIFIED = 0; + + // overwrites the table data. + WRITE_TRUNCATE = 1; + + // the data is appended to the table. + // Note duplication might happen if this mode is used. + WRITE_APPEND = 2; +} + +// Represents the request of the ListDataSourceDefinitions method. +message ListDataSourceDefinitionsRequest { + // The BigQuery project id for which data sources should be returned. + // Must be in the form: `projects/{project_id}/locations/{location_id}` + string parent = 1; + + // Pagination token, which can be used to request a specific page + // of `ListDataSourceDefinitionsRequest` list results. For multiple-page + // results, `ListDataSourceDefinitionsResponse` outputs a `next_page` token, + // which can be used as the `page_token` value to request the next page of + // the list results. + string page_token = 2; + + // Page size. The default page size is the maximum value of 1000 results. + int32 page_size = 3; +} + +// Returns a list of supported data source definitions. +message ListDataSourceDefinitionsResponse { + // List of supported data source definitions. + repeated DataSourceDefinition data_source_definitions = 1; + + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `ListDataSourceDefinitionsRequest.page_token` + // to request the next page of the list results. + string next_page_token = 2; +} + +// Represents the data source definition. +message DataSourceDefinition { + // The resource name of the data source definition. + // Data source definition names have the form + // `projects/{project_id}/locations/{location}/dataSourceDefinitions/{data_source_id}`. + string name = 21; + + // Data source metadata. + DataSource data_source = 1; + + // The Pub/Sub topic to be used for broadcasting a message when a transfer run + // is created. Both this topic and transfer_config_pubsub_topic can be + // set to a custom topic. By default, both topics are auto-generated if none + // of them is provided when creating the definition. However, if one topic is + // manually set, the other topic has to be manually set as well. The only + // difference is that transfer_run_pubsub_topic must be a non-empty Pub/Sub + // topic, but transfer_config_pubsub_topic can be set to empty. The comments + // about "{location}" for transfer_config_pubsub_topic apply here too. + string transfer_run_pubsub_topic = 13; + + // Duration which should be added to schedule_time to calculate + // run_time when job is scheduled. Only applicable for automatically + // scheduled transfer runs. Used to start a run early on a data source that + // supports continuous data refresh to compensate for unknown timezone + // offsets. Use a negative number to start a run late for data sources not + // supporting continuous data refresh. + google.protobuf.Duration run_time_offset = 16; + + // Support e-mail address of the OAuth client's Brand, which contains the + // consent screen data. + string support_email = 22; + + // When service account is specified, BigQuery will share created dataset + // with the given service account. Also, this service account will be + // eligible to perform status updates and message logging for data transfer + // runs for the corresponding data_source_id. + string service_account = 2; + + // Is data source disabled? If true, data_source is not visible. + // API will also stop returning any data transfer configs and/or runs + // associated with the data source. This setting has higher priority + // than whitelisted_project_ids. + bool disabled = 5; + + // The Pub/Sub topic to use for broadcasting a message for transfer config. If + // empty, a message will not be broadcasted. Both this topic and + // transfer_run_pubsub_topic are auto-generated if none of them is provided + // when creating the definition. It is recommended to provide + // transfer_config_pubsub_topic if a user-owned transfer_run_pubsub_topic is + // provided. Otherwise, it will be set to empty. If "{location}" is found in + // the value, then that means, data source wants to handle message separately + // for datasets in different regions. We will replace {location} with the + // actual dataset location, as the actual topic name. For example, + // projects/connector/topics/scheduler-{location} could become + // projects/connector/topics/scheduler-us. If "{location}" is not found, then + // we will use the input value as topic name. + string transfer_config_pubsub_topic = 12; + + // Supported location_ids used for deciding in which locations Pub/Sub topics + // need to be created. If custom Pub/Sub topics are used and they contains + // '{location}', the location_ids will be used for validating the topics by + // replacing the '{location}' with the individual location in the list. The + // valid values are the "location_id" field of the response of `GET + // https://bigquerydatatransfer.googleapis.com/v1/{name=projects/*}/locations` + // In addition, if the data source needs to support all available regions, + // supported_location_ids can be set to "global" (a single string element). + // When "global" is specified: + // 1) the data source implementation is supposed to stage the data in proper + // region of the destination dataset; + // 2) Data source developer should be aware of the implications (e.g., network + // traffic latency, potential charge associated with cross-region traffic, + // etc.) of supporting the "global" region; + repeated string supported_location_ids = 23; +} diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto new file mode 100644 index 00000000000..28dd2d8e355 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto @@ -0,0 +1,854 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.datatransfer.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/bigquery/datatransfer/v1/transfer.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer"; +option java_multiple_files = true; +option java_outer_classname = "DataTransferProto"; +option java_package = "com.google.cloud.bigquery.datatransfer.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1"; +option ruby_package = "Google::Cloud::Bigquery::DataTransfer::V1"; + +// This API allows users to manage their data transfers into BigQuery. +service DataTransferService { + option (google.api.default_host) = "bigquerydatatransfer.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves a supported data source and returns its settings. + rpc GetDataSource(GetDataSourceRequest) returns (DataSource) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dataSources/*}" + additional_bindings { + get: "/v1/{name=projects/*/dataSources/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists supported data sources and returns their settings. + rpc ListDataSources(ListDataSourcesRequest) returns (ListDataSourcesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dataSources" + additional_bindings { + get: "/v1/{parent=projects/*}/dataSources" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new data transfer configuration. + rpc CreateTransferConfig(CreateTransferConfigRequest) returns (TransferConfig) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/transferConfigs" + body: "transfer_config" + additional_bindings { + post: "/v1/{parent=projects/*}/transferConfigs" + body: "transfer_config" + } + }; + option (google.api.method_signature) = "parent,transfer_config"; + } + + // Updates a data transfer configuration. + // All fields must be set, even if they are not updated. + rpc UpdateTransferConfig(UpdateTransferConfigRequest) returns (TransferConfig) { + option (google.api.http) = { + patch: "/v1/{transfer_config.name=projects/*/locations/*/transferConfigs/*}" + body: "transfer_config" + additional_bindings { + patch: "/v1/{transfer_config.name=projects/*/transferConfigs/*}" + body: "transfer_config" + } + }; + option (google.api.method_signature) = "transfer_config,update_mask"; + } + + // Deletes a data transfer configuration, including any associated transfer + // runs and logs. + rpc DeleteTransferConfig(DeleteTransferConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/transferConfigs/*}" + additional_bindings { + delete: "/v1/{name=projects/*/transferConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns information about a data transfer config. + rpc GetTransferConfig(GetTransferConfigRequest) returns (TransferConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/transferConfigs/*}" + additional_bindings { + get: "/v1/{name=projects/*/transferConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns information about all transfer configs owned by a project in the + // specified location. + rpc ListTransferConfigs(ListTransferConfigsRequest) returns (ListTransferConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/transferConfigs" + additional_bindings { + get: "/v1/{parent=projects/*}/transferConfigs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates transfer runs for a time range [start_time, end_time]. + // For each date - or whatever granularity the data source supports - in the + // range, one transfer run is created. + // Note that runs are created per UTC time in the time range. + // DEPRECATED: use StartManualTransferRuns instead. + rpc ScheduleTransferRuns(ScheduleTransferRunsRequest) returns (ScheduleTransferRunsResponse) { + option deprecated = true; + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/transferConfigs/*}:scheduleRuns" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*/transferConfigs/*}:scheduleRuns" + body: "*" + } + }; + option (google.api.method_signature) = "parent,start_time,end_time"; + } + + // Start manual transfer runs to be executed now with schedule_time equal to + // current time. The transfer runs can be created for a time range where the + // run_time is between start_time (inclusive) and end_time (exclusive), or for + // a specific run_time. + rpc StartManualTransferRuns(StartManualTransferRunsRequest) returns (StartManualTransferRunsResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/transferConfigs/*}:startManualRuns" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*/transferConfigs/*}:startManualRuns" + body: "*" + } + }; + } + + // Returns information about the particular transfer run. + rpc GetTransferRun(GetTransferRunRequest) returns (TransferRun) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}" + additional_bindings { + get: "/v1/{name=projects/*/transferConfigs/*/runs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified transfer run. + rpc DeleteTransferRun(DeleteTransferRunRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}" + additional_bindings { + delete: "/v1/{name=projects/*/transferConfigs/*/runs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns information about running and completed transfer runs. + rpc ListTransferRuns(ListTransferRunsRequest) returns (ListTransferRunsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/transferConfigs/*}/runs" + additional_bindings { + get: "/v1/{parent=projects/*/transferConfigs/*}/runs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Returns log messages for the transfer run. + rpc ListTransferLogs(ListTransferLogsRequest) returns (ListTransferLogsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/transferConfigs/*/runs/*}/transferLogs" + additional_bindings { + get: "/v1/{parent=projects/*/transferConfigs/*/runs/*}/transferLogs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Returns true if valid credentials exist for the given data source and + // requesting user. + rpc CheckValidCreds(CheckValidCredsRequest) returns (CheckValidCredsResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/dataSources/*}:checkValidCreds" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/dataSources/*}:checkValidCreds" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Enroll data sources in a user project. This allows users to create transfer + // configurations for these data sources. They will also appear in the + // ListDataSources RPC and as such, will appear in the BigQuery UI + // 'https://bigquery.cloud.google.com' (and the documents can be found at + // https://cloud.google.com/bigquery/bigquery-web-ui and + // https://cloud.google.com/bigquery/docs/working-with-transfers). + rpc EnrollDataSources(EnrollDataSourcesRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*}:enrollDataSources" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*}:enrollDataSources" + body: "*" + } + }; + } +} + +// A parameter used to define custom fields in a data source definition. +message DataSourceParameter { + // Parameter type. + enum Type { + // Type unspecified. + TYPE_UNSPECIFIED = 0; + + // String parameter. + STRING = 1; + + // Integer parameter (64-bits). + // Will be serialized to json as string. + INTEGER = 2; + + // Double precision floating point parameter. + DOUBLE = 3; + + // Boolean parameter. + BOOLEAN = 4; + + // Deprecated. This field has no effect. + RECORD = 5; + + // Page ID for a Google+ Page. + PLUS_PAGE = 6; + } + + // Parameter identifier. + string param_id = 1; + + // Parameter display name in the user interface. + string display_name = 2; + + // Parameter description. + string description = 3; + + // Parameter type. + Type type = 4; + + // Is parameter required. + bool required = 5; + + // Deprecated. This field has no effect. + bool repeated = 6; + + // Regular expression which can be used for parameter validation. + string validation_regex = 7; + + // All possible values for the parameter. + repeated string allowed_values = 8; + + // For integer and double values specifies minimum allowed value. + google.protobuf.DoubleValue min_value = 9; + + // For integer and double values specifies maxminum allowed value. + google.protobuf.DoubleValue max_value = 10; + + // Deprecated. This field has no effect. + repeated DataSourceParameter fields = 11; + + // Description of the requirements for this field, in case the user input does + // not fulfill the regex pattern or min/max values. + string validation_description = 12; + + // URL to a help document to further explain the naming requirements. + string validation_help_url = 13; + + // Cannot be changed after initial creation. + bool immutable = 14; + + // Deprecated. This field has no effect. + bool recurse = 15; + + // If true, it should not be used in new transfers, and it should not be + // visible to users. + bool deprecated = 20; +} + +// Defines the properties and custom parameters for a data source. +message DataSource { + option (google.api.resource) = { + type: "bigquerydatatransfer.googleapis.com/DataSource" + pattern: "projects/{project}/dataSources/{data_source}" + pattern: "projects/{project}/locations/{location}/dataSources/{data_source}" + }; + + // The type of authorization needed for this data source. + enum AuthorizationType { + // Type unspecified. + AUTHORIZATION_TYPE_UNSPECIFIED = 0; + + // Use OAuth 2 authorization codes that can be exchanged + // for a refresh token on the backend. + AUTHORIZATION_CODE = 1; + + // Return an authorization code for a given Google+ page that can then be + // exchanged for a refresh token on the backend. + GOOGLE_PLUS_AUTHORIZATION_CODE = 2; + + // Use First Party OAuth. + FIRST_PARTY_OAUTH = 3; + } + + // Represents how the data source supports data auto refresh. + enum DataRefreshType { + // The data source won't support data auto refresh, which is default value. + DATA_REFRESH_TYPE_UNSPECIFIED = 0; + + // The data source supports data auto refresh, and runs will be scheduled + // for the past few days. Does not allow custom values to be set for each + // transfer config. + SLIDING_WINDOW = 1; + + // The data source supports data auto refresh, and runs will be scheduled + // for the past few days. Allows custom values to be set for each transfer + // config. + CUSTOM_SLIDING_WINDOW = 2; + } + + // Output only. Data source resource name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Data source id. + string data_source_id = 2; + + // User friendly data source name. + string display_name = 3; + + // User friendly data source description string. + string description = 4; + + // Data source client id which should be used to receive refresh token. + string client_id = 5; + + // Api auth scopes for which refresh token needs to be obtained. These are + // scopes needed by a data source to prepare data and ingest them into + // BigQuery, e.g., https://www.googleapis.com/auth/bigquery + repeated string scopes = 6; + + // Deprecated. This field has no effect. + TransferType transfer_type = 7 [deprecated = true]; + + // Deprecated. This field has no effect. + bool supports_multiple_transfers = 8 [deprecated = true]; + + // The number of seconds to wait for an update from the data source + // before the Data Transfer Service marks the transfer as FAILED. + int32 update_deadline_seconds = 9; + + // Default data transfer schedule. + // Examples of valid schedules include: + // `1st,3rd monday of month 15:30`, + // `every wed,fri of jan,jun 13:15`, and + // `first sunday of quarter 00:00`. + string default_schedule = 10; + + // Specifies whether the data source supports a user defined schedule, or + // operates on the default schedule. + // When set to `true`, user can override default schedule. + bool supports_custom_schedule = 11; + + // Data source parameters. + repeated DataSourceParameter parameters = 12; + + // Url for the help document for this data source. + string help_url = 13; + + // Indicates the type of authorization. + AuthorizationType authorization_type = 14; + + // Specifies whether the data source supports automatic data refresh for the + // past few days, and how it's supported. + // For some data sources, data might not be complete until a few days later, + // so it's useful to refresh data automatically. + DataRefreshType data_refresh_type = 15; + + // Default data refresh window on days. + // Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`. + int32 default_data_refresh_window_days = 16; + + // Disables backfilling and manual run scheduling + // for the data source. + bool manual_runs_disabled = 17; + + // The minimum interval for scheduler to schedule runs. + google.protobuf.Duration minimum_schedule_interval = 18; +} + +// A request to get data source info. +message GetDataSourceRequest { + // Required. The field will contain name of the resource requested, for example: + // `projects/{project_id}/dataSources/{data_source_id}` or + // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/DataSource" + } + ]; +} + +// Request to list supported data sources and their data transfer settings. +message ListDataSourcesRequest { + // Required. The BigQuery project id for which data sources should be returned. + // Must be in the form: `projects/{project_id}` or + // `projects/{project_id}/locations/{location_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigquerydatatransfer.googleapis.com/DataSource" + } + ]; + + // Pagination token, which can be used to request a specific page + // of `ListDataSourcesRequest` list results. For multiple-page + // results, `ListDataSourcesResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + string page_token = 3; + + // Page size. The default page size is the maximum value of 1000 results. + int32 page_size = 4; +} + +// Returns list of supported data sources and their metadata. +message ListDataSourcesResponse { + // List of supported data sources and their transfer settings. + repeated DataSource data_sources = 1; + + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `ListDataSourcesRequest.page_token` + // to request the next page of list results. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to create a data transfer configuration. If new credentials are +// needed for this transfer configuration, an authorization code must be +// provided. If an authorization code is provided, the transfer configuration +// will be associated with the user id corresponding to the authorization code. +// Otherwise, the transfer configuration will be associated with the calling +// user. +message CreateTransferConfigRequest { + // Required. The BigQuery project id where the transfer configuration should be created. + // Must be in the format projects/{project_id}/locations/{location_id} or + // projects/{project_id}. If specified location and location of the + // destination bigquery dataset do not match - the request will fail. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigquerydatatransfer.googleapis.com/TransferConfig" + } + ]; + + // Required. Data transfer configuration to create. + TransferConfig transfer_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional OAuth2 authorization code to use with this transfer configuration. + // This is required if new credentials are needed, as indicated by + // `CheckValidCreds`. + // In order to obtain authorization_code, please make a + // request to + // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + // + // * client_id should be OAuth client_id of BigQuery DTS API for the given + // data source returned by ListDataSources method. + // * data_source_scopes are the scopes returned by ListDataSources method. + // * redirect_uri is an optional parameter. If not specified, then + // authorization code is posted to the opener of authorization flow window. + // Otherwise it will be sent to the redirect uri. A special value of + // urn:ietf:wg:oauth:2.0:oob means that authorization code should be + // returned in the title bar of the browser, with the page text prompting + // the user to copy the code and paste it in the application. + string authorization_code = 3; + + // Optional version info. If users want to find a very recent access token, + // that is, immediately after approving access, users have to set the + // version_info claim in the token request. To obtain the version_info, users + // must use the "none+gsession" response type. which be return a + // version_info back in the authorization response which be be put in a JWT + // claim in the token request. + string version_info = 5; + + // Optional service account name. If this field is set, transfer config will + // be created with this service account credentials. It requires that + // requesting user calling this API has permissions to act as this service + // account. + string service_account_name = 6; +} + +// A request to update a transfer configuration. To update the user id of the +// transfer configuration, an authorization code needs to be provided. +message UpdateTransferConfigRequest { + // Required. Data transfer configuration to create. + TransferConfig transfer_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional OAuth2 authorization code to use with this transfer configuration. + // If it is provided, the transfer configuration will be associated with the + // authorizing user. + // In order to obtain authorization_code, please make a + // request to + // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + // + // * client_id should be OAuth client_id of BigQuery DTS API for the given + // data source returned by ListDataSources method. + // * data_source_scopes are the scopes returned by ListDataSources method. + // * redirect_uri is an optional parameter. If not specified, then + // authorization code is posted to the opener of authorization flow window. + // Otherwise it will be sent to the redirect uri. A special value of + // urn:ietf:wg:oauth:2.0:oob means that authorization code should be + // returned in the title bar of the browser, with the page text prompting + // the user to copy the code and paste it in the application. + string authorization_code = 3; + + // Required. Required list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional version info. If users want to find a very recent access token, + // that is, immediately after approving access, users have to set the + // version_info claim in the token request. To obtain the version_info, users + // must use the "none+gsession" response type. which be return a + // version_info back in the authorization response which be be put in a JWT + // claim in the token request. + string version_info = 5; + + // Optional service account name. If this field is set and + // "service_account_name" is set in update_mask, transfer config will be + // updated to use this service account credentials. It requires that + // requesting user calling this API has permissions to act as this service + // account. + string service_account_name = 6; +} + +// A request to get data transfer information. +message GetTransferConfigRequest { + // Required. The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/TransferConfig" + } + ]; +} + +// A request to delete data transfer information. All associated transfer runs +// and log messages will be deleted as well. +message DeleteTransferConfigRequest { + // Required. The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/TransferConfig" + } + ]; +} + +// A request to get data transfer run information. +message GetTransferRunRequest { + // Required. The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/Run" + } + ]; +} + +// A request to delete data transfer run information. +message DeleteTransferRunRequest { + // Required. The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/Run" + } + ]; +} + +// A request to list data transfers configured for a BigQuery project. +message ListTransferConfigsRequest { + // Required. The BigQuery project id for which data sources + // should be returned: `projects/{project_id}` or + // `projects/{project_id}/locations/{location_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigquerydatatransfer.googleapis.com/TransferConfig" + } + ]; + + // When specified, only configurations of requested data sources are returned. + repeated string data_source_ids = 2; + + // Pagination token, which can be used to request a specific page + // of `ListTransfersRequest` list results. For multiple-page + // results, `ListTransfersResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + string page_token = 3; + + // Page size. The default page size is the maximum value of 1000 results. + int32 page_size = 4; +} + +// The returned list of pipelines in the project. +message ListTransferConfigsResponse { + // Output only. The stored pipeline transfer configurations. + repeated TransferConfig transfer_configs = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `ListTransferConfigsRequest.page_token` + // to request the next page of list results. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to list data transfer runs. +message ListTransferRunsRequest { + // Represents which runs should be pulled. + enum RunAttempt { + // All runs should be returned. + RUN_ATTEMPT_UNSPECIFIED = 0; + + // Only latest run per day should be returned. + LATEST = 1; + } + + // Required. Name of transfer configuration for which transfer runs should be retrieved. + // Format of transfer configuration resource name is: + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigquerydatatransfer.googleapis.com/Run" + } + ]; + + // When specified, only transfer runs with requested states are returned. + repeated TransferState states = 2; + + // Pagination token, which can be used to request a specific page + // of `ListTransferRunsRequest` list results. For multiple-page + // results, `ListTransferRunsResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + string page_token = 3; + + // Page size. The default page size is the maximum value of 1000 results. + int32 page_size = 4; + + // Indicates how run attempts are to be pulled. + RunAttempt run_attempt = 5; +} + +// The returned list of pipelines in the project. +message ListTransferRunsResponse { + // Output only. The stored pipeline transfer runs. + repeated TransferRun transfer_runs = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `ListTransferRunsRequest.page_token` + // to request the next page of list results. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to get user facing log messages associated with data transfer run. +message ListTransferLogsRequest { + // Required. Transfer run name in the form: + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/Run" + } + ]; + + // Pagination token, which can be used to request a specific page + // of `ListTransferLogsRequest` list results. For multiple-page + // results, `ListTransferLogsResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + string page_token = 4; + + // Page size. The default page size is the maximum value of 1000 results. + int32 page_size = 5; + + // Message types to return. If not populated - INFO, WARNING and ERROR + // messages are returned. + repeated TransferMessage.MessageSeverity message_types = 6; +} + +// The returned list transfer run messages. +message ListTransferLogsResponse { + // Output only. The stored pipeline transfer messages. + repeated TransferMessage transfer_messages = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `GetTransferRunLogRequest.page_token` + // to request the next page of list results. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to determine whether the user has valid credentials. This method +// is used to limit the number of OAuth popups in the user interface. The +// user id is inferred from the API call context. +// If the data source has the Google+ authorization type, this method +// returns false, as it cannot be determined whether the credentials are +// already valid merely based on the user id. +message CheckValidCredsRequest { + // Required. The data source in the form: + // `projects/{project_id}/dataSources/{data_source_id}` or + // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/DataSource" + } + ]; +} + +// A response indicating whether the credentials exist and are valid. +message CheckValidCredsResponse { + // If set to `true`, the credentials exist and are valid. + bool has_valid_creds = 1; +} + +// A request to schedule transfer runs for a time range. +message ScheduleTransferRunsRequest { + // Required. Transfer configuration name in the form: + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/TransferConfig" + } + ]; + + // Required. Start time of the range of transfer runs. For example, + // `"2017-05-25T00:00:00+00:00"`. + google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. End time of the range of transfer runs. For example, + // `"2017-05-30T00:00:00+00:00"`. + google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A response to schedule transfer runs for a time range. +message ScheduleTransferRunsResponse { + // The transfer runs that were scheduled. + repeated TransferRun runs = 1; +} + +// A request to start manual transfer runs. +message StartManualTransferRunsRequest { + // A specification for a time range, this will request transfer runs with + // run_time between start_time (inclusive) and end_time (exclusive). + message TimeRange { + // Start time of the range of transfer runs. For example, + // `"2017-05-25T00:00:00+00:00"`. The start_time must be strictly less than + // the end_time. Creates transfer runs where run_time is in the range + // between start_time (inclusive) and end_time (exclusive). + google.protobuf.Timestamp start_time = 1; + + // End time of the range of transfer runs. For example, + // `"2017-05-30T00:00:00+00:00"`. The end_time must not be in the future. + // Creates transfer runs where run_time is in the range between start_time + // (inclusive) and end_time (exclusive). + google.protobuf.Timestamp end_time = 2; + } + + // Transfer configuration name in the form: + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + string parent = 1 [(google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/TransferConfig" + }]; + + // The requested time specification - this can be a time range or a specific + // run_time. + oneof time { + // Time range for the transfer runs that should be started. + TimeRange requested_time_range = 3; + + // Specific run_time for a transfer run to be started. The + // requested_run_time must not be in the future. + google.protobuf.Timestamp requested_run_time = 4; + } +} + +// A response to start manual transfer runs. +message StartManualTransferRunsResponse { + // The transfer runs that were created. + repeated TransferRun runs = 1; +} + +// A request to enroll a set of data sources so they are visible in the +// BigQuery UI's `Transfer` tab. +message EnrollDataSourcesRequest { + // The name of the project resource in the form: + // `projects/{project_id}` + string name = 1; + + // Data sources that are enrolled. It is required to provide at least one + // data source id. + repeated string data_source_ids = 2; +} diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/resourcestate.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/resourcestate.proto new file mode 100644 index 00000000000..dcc8db6e0d5 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/resourcestate.proto @@ -0,0 +1,28 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.datatransfer.v1; + +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer"; +option java_multiple_files = true; +option java_outer_classname = "ResourceStateProto"; +option java_package = "com.google.cloud.bigquery.datatransfer.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1"; diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto new file mode 100644 index 00000000000..9092b4b9e53 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto @@ -0,0 +1,309 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.datatransfer.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer"; +option java_multiple_files = true; +option java_outer_classname = "TransferProto"; +option java_package = "com.google.cloud.bigquery.datatransfer.v1"; +option objc_class_prefix = "GCBDT"; +option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1"; +option ruby_package = "Google::Cloud::Bigquery::DataTransfer::V1"; + +// DEPRECATED. Represents data transfer type. +enum TransferType { + option deprecated = true; + + // Invalid or Unknown transfer type placeholder. + TRANSFER_TYPE_UNSPECIFIED = 0; + + // Batch data transfer. + BATCH = 1; + + // Streaming data transfer. Streaming data source currently doesn't + // support multiple transfer configs per project. + STREAMING = 2; +} + +// Represents data transfer run state. +enum TransferState { + // State placeholder (0). + TRANSFER_STATE_UNSPECIFIED = 0; + + // Data transfer is scheduled and is waiting to be picked up by + // data transfer backend (2). + PENDING = 2; + + // Data transfer is in progress (3). + RUNNING = 3; + + // Data transfer completed successfully (4). + SUCCEEDED = 4; + + // Data transfer failed (5). + FAILED = 5; + + // Data transfer is cancelled (6). + CANCELLED = 6; +} + +// Represents preferences for sending email notifications for transfer run +// events. +message EmailPreferences { + // If true, email notifications will be sent on transfer run failures. + bool enable_failure_email = 1; +} + +// Options customizing the data transfer schedule. +message ScheduleOptions { + // If true, automatic scheduling of data transfer runs for this configuration + // will be disabled. The runs can be started on ad-hoc basis using + // StartManualTransferRuns API. When automatic scheduling is disabled, the + // TransferConfig.schedule field will be ignored. + bool disable_auto_scheduling = 3; + + // Specifies time to start scheduling transfer runs. The first run will be + // scheduled at or after the start time according to a recurrence pattern + // defined in the schedule string. The start time can be changed at any + // moment. The time when a data transfer can be trigerred manually is not + // limited by this option. + google.protobuf.Timestamp start_time = 1; + + // Defines time to stop scheduling transfer runs. A transfer run cannot be + // scheduled at or after the end time. The end time can be changed at any + // moment. The time when a data transfer can be trigerred manually is not + // limited by this option. + google.protobuf.Timestamp end_time = 2; +} + +// Information about a user. +message UserInfo { + // E-mail address of the user. + optional string email = 1; +} + +// Represents a data transfer configuration. A transfer configuration +// contains all metadata needed to perform a data transfer. For example, +// `destination_dataset_id` specifies where data should be stored. +// When a new transfer configuration is created, the specified +// `destination_dataset_id` is created when needed and shared with the +// appropriate data source service account. +message TransferConfig { + option (google.api.resource) = { + type: "bigquerydatatransfer.googleapis.com/TransferConfig" + pattern: "projects/{project}/transferConfigs/{transfer_config}" + pattern: "projects/{project}/locations/{location}/transferConfigs/{transfer_config}" + }; + + // The resource name of the transfer config. + // Transfer config names have the form + // `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. + // Where `config_id` is usually a uuid, even though it is not + // guaranteed or required. The name is ignored when creating a transfer + // config. + string name = 1; + + // The desination of the transfer config. + oneof destination { + // The BigQuery target dataset id. + string destination_dataset_id = 2; + } + + // User specified display name for the data transfer. + string display_name = 3; + + // Data source id. Cannot be changed once data transfer is created. + string data_source_id = 5; + + // Parameters specific to each data source. For more information see the + // bq tab in the 'Setting up a data transfer' section for each data source. + // For example the parameters for Cloud Storage transfers are listed here: + // https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + google.protobuf.Struct params = 9; + + // Data transfer schedule. + // If the data source does not support a custom schedule, this should be + // empty. If it is empty, the default value for the data source will be + // used. + // The specified times are in UTC. + // Examples of valid format: + // `1st,3rd monday of month 15:30`, + // `every wed,fri of jan,jun 13:15`, and + // `first sunday of quarter 00:00`. + // See more explanation about the format here: + // https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + // + // NOTE: The minimum interval time between recurring transfers depends on the + // data source; refer to the documentation for your data source. + string schedule = 7; + + // Options customizing the data transfer schedule. + ScheduleOptions schedule_options = 24; + + // The number of days to look back to automatically refresh the data. + // For example, if `data_refresh_window_days = 10`, then every day + // BigQuery reingests data for [today-10, today-1], rather than ingesting data + // for just [today-1]. + // Only valid if the data source supports the feature. Set the value to 0 + // to use the default value. + int32 data_refresh_window_days = 12; + + // Is this config disabled. When set to true, no runs are scheduled + // for a given transfer. + bool disabled = 13; + + // Output only. Data transfer modification time. Ignored by server on input. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Next time when data transfer will run. + google.protobuf.Timestamp next_run_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the most recently updated transfer run. + TransferState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Deprecated. Unique ID of the user on whose behalf transfer is done. + int64 user_id = 11; + + // Output only. Region in which BigQuery dataset is located. + string dataset_region = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Pub/Sub topic where notifications will be sent after transfer runs + // associated with this transfer config finish. + // + // The format for specifying a pubsub topic is: + // `projects/{project}/topics/{topic}` + string notification_pubsub_topic = 15; + + // Email notifications will be sent according to these preferences + // to the email address of the user who owns this transfer config. + EmailPreferences email_preferences = 18; + + // Output only. Information about the user whose credentials are used to transfer data. + // Populated only for `transferConfigs.get` requests. In case the user + // information is not available, this field will not be populated. + optional UserInfo owner_info = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a data transfer run. +message TransferRun { + option (google.api.resource) = { + type: "bigquerydatatransfer.googleapis.com/Run" + pattern: "projects/{project}/transferConfigs/{transfer_config}/runs/{run}" + pattern: "projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}" + }; + + // The resource name of the transfer run. + // Transfer run names have the form + // `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. + // The name is ignored when creating a transfer run. + string name = 1; + + // Minimum time after which a transfer run can be started. + google.protobuf.Timestamp schedule_time = 3; + + // For batch transfer runs, specifies the date and time of the data should be + // ingested. + google.protobuf.Timestamp run_time = 10; + + // Status of the transfer run. + google.rpc.Status error_status = 21; + + // Output only. Time when transfer run was started. + // Parameter ignored by server for input requests. + google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when transfer run ended. + // Parameter ignored by server for input requests. + google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last time the data transfer run state was updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Parameters specific to each data source. For more information see the + // bq tab in the 'Setting up a data transfer' section for each data source. + // For example the parameters for Cloud Storage transfers are listed here: + // https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + google.protobuf.Struct params = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Data transfer destination. + oneof destination { + // Output only. The BigQuery target dataset id. + string destination_dataset_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Data source id. + string data_source_id = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Data transfer run state. Ignored for input requests. + TransferState state = 8; + + // Deprecated. Unique ID of the user on whose behalf transfer is done. + int64 user_id = 11; + + // Output only. Describes the schedule of this transfer run if it was + // created as part of a regular schedule. For batch transfer runs that are + // scheduled manually, this is empty. + // NOTE: the system might choose to delay the schedule depending on the + // current load, so `schedule_time` doesn't always match this. + string schedule = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pub/Sub topic where a notification will be sent after this + // transfer run finishes. + // + // The format for specifying a pubsub topic is: + // `projects/{project}/topics/{topic}` + string notification_pubsub_topic = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email notifications will be sent according to these + // preferences to the email address of the user who owns the transfer config + // this run was derived from. + EmailPreferences email_preferences = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a user facing message for a particular data transfer run. +message TransferMessage { + // Represents data transfer user facing message severity. + enum MessageSeverity { + // No severity specified. + MESSAGE_SEVERITY_UNSPECIFIED = 0; + + // Informational message. + INFO = 1; + + // Warning message. + WARNING = 2; + + // Error message. + ERROR = 3; + } + + // Time when message was logged. + google.protobuf.Timestamp message_time = 1; + + // Message severity. + MessageSeverity severity = 2; + + // Message text. + string message_text = 3; +} diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/common_resources.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts b/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts new file mode 100644 index 00000000000..de23889ab9d --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts @@ -0,0 +1,9831 @@ +// 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace bigquery. */ + namespace bigquery { + + /** Namespace datatransfer. */ + namespace datatransfer { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a DataTransferService */ + class DataTransferService extends $protobuf.rpc.Service { + + /** + * Constructs a new DataTransferService 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 DataTransferService 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): DataTransferService; + + /** + * Calls GetDataSource. + * @param request GetDataSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataSource + */ + public getDataSource(request: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.GetDataSourceCallback): void; + + /** + * Calls GetDataSource. + * @param request GetDataSourceRequest message or plain object + * @returns Promise + */ + public getDataSource(request: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest): Promise; + + /** + * Calls ListDataSources. + * @param request ListDataSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDataSourcesResponse + */ + public listDataSources(request: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.ListDataSourcesCallback): void; + + /** + * Calls ListDataSources. + * @param request ListDataSourcesRequest message or plain object + * @returns Promise + */ + public listDataSources(request: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest): Promise; + + /** + * Calls CreateTransferConfig. + * @param request CreateTransferConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferConfig + */ + public createTransferConfig(request: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.CreateTransferConfigCallback): void; + + /** + * Calls CreateTransferConfig. + * @param request CreateTransferConfigRequest message or plain object + * @returns Promise + */ + public createTransferConfig(request: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest): Promise; + + /** + * Calls UpdateTransferConfig. + * @param request UpdateTransferConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferConfig + */ + public updateTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.UpdateTransferConfigCallback): void; + + /** + * Calls UpdateTransferConfig. + * @param request UpdateTransferConfigRequest message or plain object + * @returns Promise + */ + public updateTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest): Promise; + + /** + * Calls DeleteTransferConfig. + * @param request DeleteTransferConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferConfigCallback): void; + + /** + * Calls DeleteTransferConfig. + * @param request DeleteTransferConfigRequest message or plain object + * @returns Promise + */ + public deleteTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest): Promise; + + /** + * Calls GetTransferConfig. + * @param request GetTransferConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferConfig + */ + public getTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferConfigCallback): void; + + /** + * Calls GetTransferConfig. + * @param request GetTransferConfigRequest message or plain object + * @returns Promise + */ + public getTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest): Promise; + + /** + * Calls ListTransferConfigs. + * @param request ListTransferConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTransferConfigsResponse + */ + public listTransferConfigs(request: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferConfigsCallback): void; + + /** + * Calls ListTransferConfigs. + * @param request ListTransferConfigsRequest message or plain object + * @returns Promise + */ + public listTransferConfigs(request: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest): Promise; + + /** + * Calls ScheduleTransferRuns. + * @param request ScheduleTransferRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScheduleTransferRunsResponse + */ + public scheduleTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.ScheduleTransferRunsCallback): void; + + /** + * Calls ScheduleTransferRuns. + * @param request ScheduleTransferRunsRequest message or plain object + * @returns Promise + */ + public scheduleTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest): Promise; + + /** + * Calls StartManualTransferRuns. + * @param request StartManualTransferRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StartManualTransferRunsResponse + */ + public startManualTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.StartManualTransferRunsCallback): void; + + /** + * Calls StartManualTransferRuns. + * @param request StartManualTransferRunsRequest message or plain object + * @returns Promise + */ + public startManualTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest): Promise; + + /** + * Calls GetTransferRun. + * @param request GetTransferRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferRun + */ + public getTransferRun(request: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferRunCallback): void; + + /** + * Calls GetTransferRun. + * @param request GetTransferRunRequest message or plain object + * @returns Promise + */ + public getTransferRun(request: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest): Promise; + + /** + * Calls DeleteTransferRun. + * @param request DeleteTransferRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTransferRun(request: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferRunCallback): void; + + /** + * Calls DeleteTransferRun. + * @param request DeleteTransferRunRequest message or plain object + * @returns Promise + */ + public deleteTransferRun(request: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest): Promise; + + /** + * Calls ListTransferRuns. + * @param request ListTransferRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTransferRunsResponse + */ + public listTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferRunsCallback): void; + + /** + * Calls ListTransferRuns. + * @param request ListTransferRunsRequest message or plain object + * @returns Promise + */ + public listTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest): Promise; + + /** + * Calls ListTransferLogs. + * @param request ListTransferLogsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTransferLogsResponse + */ + public listTransferLogs(request: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferLogsCallback): void; + + /** + * Calls ListTransferLogs. + * @param request ListTransferLogsRequest message or plain object + * @returns Promise + */ + public listTransferLogs(request: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest): Promise; + + /** + * Calls CheckValidCreds. + * @param request CheckValidCredsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckValidCredsResponse + */ + public checkValidCreds(request: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.CheckValidCredsCallback): void; + + /** + * Calls CheckValidCreds. + * @param request CheckValidCredsRequest message or plain object + * @returns Promise + */ + public checkValidCreds(request: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest): Promise; + + /** + * Calls EnrollDataSources. + * @param request EnrollDataSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public enrollDataSources(request: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.EnrollDataSourcesCallback): void; + + /** + * Calls EnrollDataSources. + * @param request EnrollDataSourcesRequest message or plain object + * @returns Promise + */ + public enrollDataSources(request: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest): Promise; + } + + namespace DataTransferService { + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getDataSource}. + * @param error Error, if any + * @param [response] DataSource + */ + type GetDataSourceCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.DataSource) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listDataSources}. + * @param error Error, if any + * @param [response] ListDataSourcesResponse + */ + type ListDataSourcesCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|createTransferConfig}. + * @param error Error, if any + * @param [response] TransferConfig + */ + type CreateTransferConfigCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.TransferConfig) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|updateTransferConfig}. + * @param error Error, if any + * @param [response] TransferConfig + */ + type UpdateTransferConfigCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.TransferConfig) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|deleteTransferConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTransferConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getTransferConfig}. + * @param error Error, if any + * @param [response] TransferConfig + */ + type GetTransferConfigCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.TransferConfig) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferConfigs}. + * @param error Error, if any + * @param [response] ListTransferConfigsResponse + */ + type ListTransferConfigsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|scheduleTransferRuns}. + * @param error Error, if any + * @param [response] ScheduleTransferRunsResponse + */ + type ScheduleTransferRunsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|startManualTransferRuns}. + * @param error Error, if any + * @param [response] StartManualTransferRunsResponse + */ + type StartManualTransferRunsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getTransferRun}. + * @param error Error, if any + * @param [response] TransferRun + */ + type GetTransferRunCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.TransferRun) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|deleteTransferRun}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTransferRunCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferRuns}. + * @param error Error, if any + * @param [response] ListTransferRunsResponse + */ + type ListTransferRunsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferLogs}. + * @param error Error, if any + * @param [response] ListTransferLogsResponse + */ + type ListTransferLogsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|checkValidCreds}. + * @param error Error, if any + * @param [response] CheckValidCredsResponse + */ + type CheckValidCredsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|enrollDataSources}. + * @param error Error, if any + * @param [response] Empty + */ + type EnrollDataSourcesCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a DataSourceParameter. */ + interface IDataSourceParameter { + + /** DataSourceParameter paramId */ + paramId?: (string|null); + + /** DataSourceParameter displayName */ + displayName?: (string|null); + + /** DataSourceParameter description */ + description?: (string|null); + + /** DataSourceParameter type */ + type?: (google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type|null); + + /** DataSourceParameter required */ + required?: (boolean|null); + + /** DataSourceParameter repeated */ + repeated?: (boolean|null); + + /** DataSourceParameter validationRegex */ + validationRegex?: (string|null); + + /** DataSourceParameter allowedValues */ + allowedValues?: (string[]|null); + + /** DataSourceParameter minValue */ + minValue?: (google.protobuf.IDoubleValue|null); + + /** DataSourceParameter maxValue */ + maxValue?: (google.protobuf.IDoubleValue|null); + + /** DataSourceParameter fields */ + fields?: (google.cloud.bigquery.datatransfer.v1.IDataSourceParameter[]|null); + + /** DataSourceParameter validationDescription */ + validationDescription?: (string|null); + + /** DataSourceParameter validationHelpUrl */ + validationHelpUrl?: (string|null); + + /** DataSourceParameter immutable */ + immutable?: (boolean|null); + + /** DataSourceParameter recurse */ + recurse?: (boolean|null); + + /** DataSourceParameter deprecated */ + deprecated?: (boolean|null); + } + + /** Represents a DataSourceParameter. */ + class DataSourceParameter implements IDataSourceParameter { + + /** + * Constructs a new DataSourceParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter); + + /** DataSourceParameter paramId. */ + public paramId: string; + + /** DataSourceParameter displayName. */ + public displayName: string; + + /** DataSourceParameter description. */ + public description: string; + + /** DataSourceParameter type. */ + public type: (google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type); + + /** DataSourceParameter required. */ + public required: boolean; + + /** DataSourceParameter repeated. */ + public repeated: boolean; + + /** DataSourceParameter validationRegex. */ + public validationRegex: string; + + /** DataSourceParameter allowedValues. */ + public allowedValues: string[]; + + /** DataSourceParameter minValue. */ + public minValue?: (google.protobuf.IDoubleValue|null); + + /** DataSourceParameter maxValue. */ + public maxValue?: (google.protobuf.IDoubleValue|null); + + /** DataSourceParameter fields. */ + public fields: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter[]; + + /** DataSourceParameter validationDescription. */ + public validationDescription: string; + + /** DataSourceParameter validationHelpUrl. */ + public validationHelpUrl: string; + + /** DataSourceParameter immutable. */ + public immutable: boolean; + + /** DataSourceParameter recurse. */ + public recurse: boolean; + + /** DataSourceParameter deprecated. */ + public deprecated: boolean; + + /** + * Creates a new DataSourceParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSourceParameter instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter): google.cloud.bigquery.datatransfer.v1.DataSourceParameter; + + /** + * Encodes the specified DataSourceParameter message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify|verify} messages. + * @param message DataSourceParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSourceParameter message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify|verify} messages. + * @param message DataSourceParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSourceParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSourceParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.DataSourceParameter; + + /** + * Decodes a DataSourceParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSourceParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.DataSourceParameter; + + /** + * Verifies a DataSourceParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSourceParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSourceParameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.DataSourceParameter; + + /** + * Creates a plain object from a DataSourceParameter message. Also converts values to other types if specified. + * @param message DataSourceParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.DataSourceParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSourceParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSourceParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataSourceParameter { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + STRING = 1, + INTEGER = 2, + DOUBLE = 3, + BOOLEAN = 4, + RECORD = 5, + PLUS_PAGE = 6 + } + } + + /** Properties of a DataSource. */ + interface IDataSource { + + /** DataSource name */ + name?: (string|null); + + /** DataSource dataSourceId */ + dataSourceId?: (string|null); + + /** DataSource displayName */ + displayName?: (string|null); + + /** DataSource description */ + description?: (string|null); + + /** DataSource clientId */ + clientId?: (string|null); + + /** DataSource scopes */ + scopes?: (string[]|null); + + /** DataSource transferType */ + transferType?: (google.cloud.bigquery.datatransfer.v1.TransferType|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferType|null); + + /** DataSource supportsMultipleTransfers */ + supportsMultipleTransfers?: (boolean|null); + + /** DataSource updateDeadlineSeconds */ + updateDeadlineSeconds?: (number|null); + + /** DataSource defaultSchedule */ + defaultSchedule?: (string|null); + + /** DataSource supportsCustomSchedule */ + supportsCustomSchedule?: (boolean|null); + + /** DataSource parameters */ + parameters?: (google.cloud.bigquery.datatransfer.v1.IDataSourceParameter[]|null); + + /** DataSource helpUrl */ + helpUrl?: (string|null); + + /** DataSource authorizationType */ + authorizationType?: (google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType|null); + + /** DataSource dataRefreshType */ + dataRefreshType?: (google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType|null); + + /** DataSource defaultDataRefreshWindowDays */ + defaultDataRefreshWindowDays?: (number|null); + + /** DataSource manualRunsDisabled */ + manualRunsDisabled?: (boolean|null); + + /** DataSource minimumScheduleInterval */ + minimumScheduleInterval?: (google.protobuf.IDuration|null); + } + + /** Represents a DataSource. */ + class DataSource implements IDataSource { + + /** + * Constructs a new DataSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IDataSource); + + /** DataSource name. */ + public name: string; + + /** DataSource dataSourceId. */ + public dataSourceId: string; + + /** DataSource displayName. */ + public displayName: string; + + /** DataSource description. */ + public description: string; + + /** DataSource clientId. */ + public clientId: string; + + /** DataSource scopes. */ + public scopes: string[]; + + /** DataSource transferType. */ + public transferType: (google.cloud.bigquery.datatransfer.v1.TransferType|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferType); + + /** DataSource supportsMultipleTransfers. */ + public supportsMultipleTransfers: boolean; + + /** DataSource updateDeadlineSeconds. */ + public updateDeadlineSeconds: number; + + /** DataSource defaultSchedule. */ + public defaultSchedule: string; + + /** DataSource supportsCustomSchedule. */ + public supportsCustomSchedule: boolean; + + /** DataSource parameters. */ + public parameters: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter[]; + + /** DataSource helpUrl. */ + public helpUrl: string; + + /** DataSource authorizationType. */ + public authorizationType: (google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType); + + /** DataSource dataRefreshType. */ + public dataRefreshType: (google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType); + + /** DataSource defaultDataRefreshWindowDays. */ + public defaultDataRefreshWindowDays: number; + + /** DataSource manualRunsDisabled. */ + public manualRunsDisabled: boolean; + + /** DataSource minimumScheduleInterval. */ + public minimumScheduleInterval?: (google.protobuf.IDuration|null); + + /** + * Creates a new DataSource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSource instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IDataSource): google.cloud.bigquery.datatransfer.v1.DataSource; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.DataSource; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.DataSource; + + /** + * Verifies a DataSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.DataSource; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @param message DataSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.DataSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataSource { + + /** AuthorizationType enum. */ + enum AuthorizationType { + AUTHORIZATION_TYPE_UNSPECIFIED = 0, + AUTHORIZATION_CODE = 1, + GOOGLE_PLUS_AUTHORIZATION_CODE = 2, + FIRST_PARTY_OAUTH = 3 + } + + /** DataRefreshType enum. */ + enum DataRefreshType { + DATA_REFRESH_TYPE_UNSPECIFIED = 0, + SLIDING_WINDOW = 1, + CUSTOM_SLIDING_WINDOW = 2 + } + } + + /** Properties of a GetDataSourceRequest. */ + interface IGetDataSourceRequest { + + /** GetDataSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetDataSourceRequest. */ + class GetDataSourceRequest implements IGetDataSourceRequest { + + /** + * Constructs a new GetDataSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest); + + /** GetDataSourceRequest name. */ + public name: string; + + /** + * Creates a new GetDataSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDataSourceRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest): google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest; + + /** + * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest.verify|verify} messages. + * @param message GetDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest.verify|verify} messages. + * @param message GetDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest; + + /** + * Verifies a GetDataSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDataSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest; + + /** + * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. + * @param message GetDataSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDataSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDataSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourcesRequest. */ + interface IListDataSourcesRequest { + + /** ListDataSourcesRequest parent */ + parent?: (string|null); + + /** ListDataSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListDataSourcesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListDataSourcesRequest. */ + class ListDataSourcesRequest implements IListDataSourcesRequest { + + /** + * Constructs a new ListDataSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest); + + /** ListDataSourcesRequest parent. */ + public parent: string; + + /** ListDataSourcesRequest pageToken. */ + public pageToken: string; + + /** ListDataSourcesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListDataSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourcesRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest): google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest; + + /** + * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest.verify|verify} messages. + * @param message ListDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest.verify|verify} messages. + * @param message ListDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest; + + /** + * Verifies a ListDataSourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest; + + /** + * Creates a plain object from a ListDataSourcesRequest message. Also converts values to other types if specified. + * @param message ListDataSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourcesResponse. */ + interface IListDataSourcesResponse { + + /** ListDataSourcesResponse dataSources */ + dataSources?: (google.cloud.bigquery.datatransfer.v1.IDataSource[]|null); + + /** ListDataSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDataSourcesResponse. */ + class ListDataSourcesResponse implements IListDataSourcesResponse { + + /** + * Constructs a new ListDataSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse); + + /** ListDataSourcesResponse dataSources. */ + public dataSources: google.cloud.bigquery.datatransfer.v1.IDataSource[]; + + /** ListDataSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDataSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourcesResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse): google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse; + + /** + * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.verify|verify} messages. + * @param message ListDataSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.verify|verify} messages. + * @param message ListDataSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse; + + /** + * Verifies a ListDataSourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse; + + /** + * Creates a plain object from a ListDataSourcesResponse message. Also converts values to other types if specified. + * @param message ListDataSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTransferConfigRequest. */ + interface ICreateTransferConfigRequest { + + /** CreateTransferConfigRequest parent */ + parent?: (string|null); + + /** CreateTransferConfigRequest transferConfig */ + transferConfig?: (google.cloud.bigquery.datatransfer.v1.ITransferConfig|null); + + /** CreateTransferConfigRequest authorizationCode */ + authorizationCode?: (string|null); + + /** CreateTransferConfigRequest versionInfo */ + versionInfo?: (string|null); + + /** CreateTransferConfigRequest serviceAccountName */ + serviceAccountName?: (string|null); + } + + /** Represents a CreateTransferConfigRequest. */ + class CreateTransferConfigRequest implements ICreateTransferConfigRequest { + + /** + * Constructs a new CreateTransferConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest); + + /** CreateTransferConfigRequest parent. */ + public parent: string; + + /** CreateTransferConfigRequest transferConfig. */ + public transferConfig?: (google.cloud.bigquery.datatransfer.v1.ITransferConfig|null); + + /** CreateTransferConfigRequest authorizationCode. */ + public authorizationCode: string; + + /** CreateTransferConfigRequest versionInfo. */ + public versionInfo: string; + + /** CreateTransferConfigRequest serviceAccountName. */ + public serviceAccountName: string; + + /** + * Creates a new CreateTransferConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTransferConfigRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest): google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; + + /** + * Encodes the specified CreateTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest.verify|verify} messages. + * @param message CreateTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest.verify|verify} messages. + * @param message CreateTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTransferConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; + + /** + * Decodes a CreateTransferConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; + + /** + * Verifies a CreateTransferConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTransferConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; + + /** + * Creates a plain object from a CreateTransferConfigRequest message. Also converts values to other types if specified. + * @param message CreateTransferConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTransferConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTransferConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTransferConfigRequest. */ + interface IUpdateTransferConfigRequest { + + /** UpdateTransferConfigRequest transferConfig */ + transferConfig?: (google.cloud.bigquery.datatransfer.v1.ITransferConfig|null); + + /** UpdateTransferConfigRequest authorizationCode */ + authorizationCode?: (string|null); + + /** UpdateTransferConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTransferConfigRequest versionInfo */ + versionInfo?: (string|null); + + /** UpdateTransferConfigRequest serviceAccountName */ + serviceAccountName?: (string|null); + } + + /** Represents an UpdateTransferConfigRequest. */ + class UpdateTransferConfigRequest implements IUpdateTransferConfigRequest { + + /** + * Constructs a new UpdateTransferConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest); + + /** UpdateTransferConfigRequest transferConfig. */ + public transferConfig?: (google.cloud.bigquery.datatransfer.v1.ITransferConfig|null); + + /** UpdateTransferConfigRequest authorizationCode. */ + public authorizationCode: string; + + /** UpdateTransferConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTransferConfigRequest versionInfo. */ + public versionInfo: string; + + /** UpdateTransferConfigRequest serviceAccountName. */ + public serviceAccountName: string; + + /** + * Creates a new UpdateTransferConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTransferConfigRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest): google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest; + + /** + * Encodes the specified UpdateTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.verify|verify} messages. + * @param message UpdateTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.verify|verify} messages. + * @param message UpdateTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTransferConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest; + + /** + * Decodes an UpdateTransferConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest; + + /** + * Verifies an UpdateTransferConfigRequest message. + * @param message Plain 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 UpdateTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTransferConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest; + + /** + * Creates a plain object from an UpdateTransferConfigRequest message. Also converts values to other types if specified. + * @param message UpdateTransferConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTransferConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTransferConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTransferConfigRequest. */ + interface IGetTransferConfigRequest { + + /** GetTransferConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetTransferConfigRequest. */ + class GetTransferConfigRequest implements IGetTransferConfigRequest { + + /** + * Constructs a new GetTransferConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest); + + /** GetTransferConfigRequest name. */ + public name: string; + + /** + * Creates a new GetTransferConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTransferConfigRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest): google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest; + + /** + * Encodes the specified GetTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.verify|verify} messages. + * @param message GetTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.verify|verify} messages. + * @param message GetTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTransferConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest; + + /** + * Decodes a GetTransferConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest; + + /** + * Verifies a GetTransferConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTransferConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest; + + /** + * Creates a plain object from a GetTransferConfigRequest message. Also converts values to other types if specified. + * @param message GetTransferConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTransferConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTransferConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTransferConfigRequest. */ + interface IDeleteTransferConfigRequest { + + /** DeleteTransferConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTransferConfigRequest. */ + class DeleteTransferConfigRequest implements IDeleteTransferConfigRequest { + + /** + * Constructs a new DeleteTransferConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest); + + /** DeleteTransferConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteTransferConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTransferConfigRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest): google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest; + + /** + * Encodes the specified DeleteTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest.verify|verify} messages. + * @param message DeleteTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest.verify|verify} messages. + * @param message DeleteTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTransferConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest; + + /** + * Decodes a DeleteTransferConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest; + + /** + * Verifies a DeleteTransferConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTransferConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest; + + /** + * Creates a plain object from a DeleteTransferConfigRequest message. Also converts values to other types if specified. + * @param message DeleteTransferConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTransferConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTransferConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTransferRunRequest. */ + interface IGetTransferRunRequest { + + /** GetTransferRunRequest name */ + name?: (string|null); + } + + /** Represents a GetTransferRunRequest. */ + class GetTransferRunRequest implements IGetTransferRunRequest { + + /** + * Constructs a new GetTransferRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest); + + /** GetTransferRunRequest name. */ + public name: string; + + /** + * Creates a new GetTransferRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTransferRunRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest): google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest; + + /** + * Encodes the specified GetTransferRunRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest.verify|verify} messages. + * @param message GetTransferRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTransferRunRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest.verify|verify} messages. + * @param message GetTransferRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTransferRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest; + + /** + * Decodes a GetTransferRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest; + + /** + * Verifies a GetTransferRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTransferRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTransferRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest; + + /** + * Creates a plain object from a GetTransferRunRequest message. Also converts values to other types if specified. + * @param message GetTransferRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTransferRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTransferRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTransferRunRequest. */ + interface IDeleteTransferRunRequest { + + /** DeleteTransferRunRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTransferRunRequest. */ + class DeleteTransferRunRequest implements IDeleteTransferRunRequest { + + /** + * Constructs a new DeleteTransferRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest); + + /** DeleteTransferRunRequest name. */ + public name: string; + + /** + * Creates a new DeleteTransferRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTransferRunRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest): google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest; + + /** + * Encodes the specified DeleteTransferRunRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest.verify|verify} messages. + * @param message DeleteTransferRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTransferRunRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest.verify|verify} messages. + * @param message DeleteTransferRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTransferRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest; + + /** + * Decodes a DeleteTransferRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest; + + /** + * Verifies a DeleteTransferRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTransferRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTransferRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest; + + /** + * Creates a plain object from a DeleteTransferRunRequest message. Also converts values to other types if specified. + * @param message DeleteTransferRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTransferRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTransferRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferConfigsRequest. */ + interface IListTransferConfigsRequest { + + /** ListTransferConfigsRequest parent */ + parent?: (string|null); + + /** ListTransferConfigsRequest dataSourceIds */ + dataSourceIds?: (string[]|null); + + /** ListTransferConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListTransferConfigsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListTransferConfigsRequest. */ + class ListTransferConfigsRequest implements IListTransferConfigsRequest { + + /** + * Constructs a new ListTransferConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest); + + /** ListTransferConfigsRequest parent. */ + public parent: string; + + /** ListTransferConfigsRequest dataSourceIds. */ + public dataSourceIds: string[]; + + /** ListTransferConfigsRequest pageToken. */ + public pageToken: string; + + /** ListTransferConfigsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListTransferConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferConfigsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest; + + /** + * Encodes the specified ListTransferConfigsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest.verify|verify} messages. + * @param message ListTransferConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest.verify|verify} messages. + * @param message ListTransferConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest; + + /** + * Decodes a ListTransferConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest; + + /** + * Verifies a ListTransferConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest; + + /** + * Creates a plain object from a ListTransferConfigsRequest message. Also converts values to other types if specified. + * @param message ListTransferConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferConfigsResponse. */ + interface IListTransferConfigsResponse { + + /** ListTransferConfigsResponse transferConfigs */ + transferConfigs?: (google.cloud.bigquery.datatransfer.v1.ITransferConfig[]|null); + + /** ListTransferConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTransferConfigsResponse. */ + class ListTransferConfigsResponse implements IListTransferConfigsResponse { + + /** + * Constructs a new ListTransferConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse); + + /** ListTransferConfigsResponse transferConfigs. */ + public transferConfigs: google.cloud.bigquery.datatransfer.v1.ITransferConfig[]; + + /** ListTransferConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTransferConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferConfigsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse; + + /** + * Encodes the specified ListTransferConfigsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.verify|verify} messages. + * @param message ListTransferConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.verify|verify} messages. + * @param message ListTransferConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse; + + /** + * Decodes a ListTransferConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse; + + /** + * Verifies a ListTransferConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse; + + /** + * Creates a plain object from a ListTransferConfigsResponse message. Also converts values to other types if specified. + * @param message ListTransferConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferRunsRequest. */ + interface IListTransferRunsRequest { + + /** ListTransferRunsRequest parent */ + parent?: (string|null); + + /** ListTransferRunsRequest states */ + states?: (google.cloud.bigquery.datatransfer.v1.TransferState[]|null); + + /** ListTransferRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListTransferRunsRequest pageSize */ + pageSize?: (number|null); + + /** ListTransferRunsRequest runAttempt */ + runAttempt?: (google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt|keyof typeof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt|null); + } + + /** Represents a ListTransferRunsRequest. */ + class ListTransferRunsRequest implements IListTransferRunsRequest { + + /** + * Constructs a new ListTransferRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest); + + /** ListTransferRunsRequest parent. */ + public parent: string; + + /** ListTransferRunsRequest states. */ + public states: google.cloud.bigquery.datatransfer.v1.TransferState[]; + + /** ListTransferRunsRequest pageToken. */ + public pageToken: string; + + /** ListTransferRunsRequest pageSize. */ + public pageSize: number; + + /** ListTransferRunsRequest runAttempt. */ + public runAttempt: (google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt|keyof typeof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt); + + /** + * Creates a new ListTransferRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferRunsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest): google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest; + + /** + * Encodes the specified ListTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.verify|verify} messages. + * @param message ListTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.verify|verify} messages. + * @param message ListTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest; + + /** + * Decodes a ListTransferRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest; + + /** + * Verifies a ListTransferRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest; + + /** + * Creates a plain object from a ListTransferRunsRequest message. Also converts values to other types if specified. + * @param message ListTransferRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListTransferRunsRequest { + + /** RunAttempt enum. */ + enum RunAttempt { + RUN_ATTEMPT_UNSPECIFIED = 0, + LATEST = 1 + } + } + + /** Properties of a ListTransferRunsResponse. */ + interface IListTransferRunsResponse { + + /** ListTransferRunsResponse transferRuns */ + transferRuns?: (google.cloud.bigquery.datatransfer.v1.ITransferRun[]|null); + + /** ListTransferRunsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTransferRunsResponse. */ + class ListTransferRunsResponse implements IListTransferRunsResponse { + + /** + * Constructs a new ListTransferRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse); + + /** ListTransferRunsResponse transferRuns. */ + public transferRuns: google.cloud.bigquery.datatransfer.v1.ITransferRun[]; + + /** ListTransferRunsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTransferRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferRunsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse): google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse; + + /** + * Encodes the specified ListTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.verify|verify} messages. + * @param message ListTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.verify|verify} messages. + * @param message ListTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse; + + /** + * Decodes a ListTransferRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse; + + /** + * Verifies a ListTransferRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse; + + /** + * Creates a plain object from a ListTransferRunsResponse message. Also converts values to other types if specified. + * @param message ListTransferRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferLogsRequest. */ + interface IListTransferLogsRequest { + + /** ListTransferLogsRequest parent */ + parent?: (string|null); + + /** ListTransferLogsRequest pageToken */ + pageToken?: (string|null); + + /** ListTransferLogsRequest pageSize */ + pageSize?: (number|null); + + /** ListTransferLogsRequest messageTypes */ + messageTypes?: (google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity[]|null); + } + + /** Represents a ListTransferLogsRequest. */ + class ListTransferLogsRequest implements IListTransferLogsRequest { + + /** + * Constructs a new ListTransferLogsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest); + + /** ListTransferLogsRequest parent. */ + public parent: string; + + /** ListTransferLogsRequest pageToken. */ + public pageToken: string; + + /** ListTransferLogsRequest pageSize. */ + public pageSize: number; + + /** ListTransferLogsRequest messageTypes. */ + public messageTypes: google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity[]; + + /** + * Creates a new ListTransferLogsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferLogsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest): google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest; + + /** + * Encodes the specified ListTransferLogsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest.verify|verify} messages. + * @param message ListTransferLogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferLogsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest.verify|verify} messages. + * @param message ListTransferLogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferLogsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferLogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest; + + /** + * Decodes a ListTransferLogsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferLogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest; + + /** + * Verifies a ListTransferLogsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferLogsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferLogsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest; + + /** + * Creates a plain object from a ListTransferLogsRequest message. Also converts values to other types if specified. + * @param message ListTransferLogsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferLogsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferLogsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferLogsResponse. */ + interface IListTransferLogsResponse { + + /** ListTransferLogsResponse transferMessages */ + transferMessages?: (google.cloud.bigquery.datatransfer.v1.ITransferMessage[]|null); + + /** ListTransferLogsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTransferLogsResponse. */ + class ListTransferLogsResponse implements IListTransferLogsResponse { + + /** + * Constructs a new ListTransferLogsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse); + + /** ListTransferLogsResponse transferMessages. */ + public transferMessages: google.cloud.bigquery.datatransfer.v1.ITransferMessage[]; + + /** ListTransferLogsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTransferLogsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferLogsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse): google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse; + + /** + * Encodes the specified ListTransferLogsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.verify|verify} messages. + * @param message ListTransferLogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferLogsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.verify|verify} messages. + * @param message ListTransferLogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferLogsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferLogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse; + + /** + * Decodes a ListTransferLogsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferLogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse; + + /** + * Verifies a ListTransferLogsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferLogsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferLogsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse; + + /** + * Creates a plain object from a ListTransferLogsResponse message. Also converts values to other types if specified. + * @param message ListTransferLogsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferLogsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferLogsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckValidCredsRequest. */ + interface ICheckValidCredsRequest { + + /** CheckValidCredsRequest name */ + name?: (string|null); + } + + /** Represents a CheckValidCredsRequest. */ + class CheckValidCredsRequest implements ICheckValidCredsRequest { + + /** + * Constructs a new CheckValidCredsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest); + + /** CheckValidCredsRequest name. */ + public name: string; + + /** + * Creates a new CheckValidCredsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckValidCredsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest): google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest; + + /** + * Encodes the specified CheckValidCredsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest.verify|verify} messages. + * @param message CheckValidCredsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckValidCredsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest.verify|verify} messages. + * @param message CheckValidCredsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckValidCredsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckValidCredsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest; + + /** + * Decodes a CheckValidCredsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckValidCredsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest; + + /** + * Verifies a CheckValidCredsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckValidCredsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckValidCredsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest; + + /** + * Creates a plain object from a CheckValidCredsRequest message. Also converts values to other types if specified. + * @param message CheckValidCredsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckValidCredsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckValidCredsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckValidCredsResponse. */ + interface ICheckValidCredsResponse { + + /** CheckValidCredsResponse hasValidCreds */ + hasValidCreds?: (boolean|null); + } + + /** Represents a CheckValidCredsResponse. */ + class CheckValidCredsResponse implements ICheckValidCredsResponse { + + /** + * Constructs a new CheckValidCredsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse); + + /** CheckValidCredsResponse hasValidCreds. */ + public hasValidCreds: boolean; + + /** + * Creates a new CheckValidCredsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckValidCredsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse): google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse; + + /** + * Encodes the specified CheckValidCredsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse.verify|verify} messages. + * @param message CheckValidCredsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckValidCredsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse.verify|verify} messages. + * @param message CheckValidCredsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckValidCredsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckValidCredsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse; + + /** + * Decodes a CheckValidCredsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckValidCredsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse; + + /** + * Verifies a CheckValidCredsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckValidCredsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckValidCredsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse; + + /** + * Creates a plain object from a CheckValidCredsResponse message. Also converts values to other types if specified. + * @param message CheckValidCredsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckValidCredsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckValidCredsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleTransferRunsRequest. */ + interface IScheduleTransferRunsRequest { + + /** ScheduleTransferRunsRequest parent */ + parent?: (string|null); + + /** ScheduleTransferRunsRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ScheduleTransferRunsRequest endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ScheduleTransferRunsRequest. */ + class ScheduleTransferRunsRequest implements IScheduleTransferRunsRequest { + + /** + * Constructs a new ScheduleTransferRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest); + + /** ScheduleTransferRunsRequest parent. */ + public parent: string; + + /** ScheduleTransferRunsRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ScheduleTransferRunsRequest endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ScheduleTransferRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleTransferRunsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest; + + /** + * Encodes the specified ScheduleTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.verify|verify} messages. + * @param message ScheduleTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduleTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.verify|verify} messages. + * @param message ScheduleTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleTransferRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduleTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest; + + /** + * Decodes a ScheduleTransferRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduleTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest; + + /** + * Verifies a ScheduleTransferRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScheduleTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduleTransferRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest; + + /** + * Creates a plain object from a ScheduleTransferRunsRequest message. Also converts values to other types if specified. + * @param message ScheduleTransferRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduleTransferRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScheduleTransferRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleTransferRunsResponse. */ + interface IScheduleTransferRunsResponse { + + /** ScheduleTransferRunsResponse runs */ + runs?: (google.cloud.bigquery.datatransfer.v1.ITransferRun[]|null); + } + + /** Represents a ScheduleTransferRunsResponse. */ + class ScheduleTransferRunsResponse implements IScheduleTransferRunsResponse { + + /** + * Constructs a new ScheduleTransferRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse); + + /** ScheduleTransferRunsResponse runs. */ + public runs: google.cloud.bigquery.datatransfer.v1.ITransferRun[]; + + /** + * Creates a new ScheduleTransferRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleTransferRunsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse; + + /** + * Encodes the specified ScheduleTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.verify|verify} messages. + * @param message ScheduleTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduleTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.verify|verify} messages. + * @param message ScheduleTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleTransferRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduleTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse; + + /** + * Decodes a ScheduleTransferRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduleTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse; + + /** + * Verifies a ScheduleTransferRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScheduleTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduleTransferRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse; + + /** + * Creates a plain object from a ScheduleTransferRunsResponse message. Also converts values to other types if specified. + * @param message ScheduleTransferRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduleTransferRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScheduleTransferRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartManualTransferRunsRequest. */ + interface IStartManualTransferRunsRequest { + + /** StartManualTransferRunsRequest parent */ + parent?: (string|null); + + /** StartManualTransferRunsRequest requestedTimeRange */ + requestedTimeRange?: (google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange|null); + + /** StartManualTransferRunsRequest requestedRunTime */ + requestedRunTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a StartManualTransferRunsRequest. */ + class StartManualTransferRunsRequest implements IStartManualTransferRunsRequest { + + /** + * Constructs a new StartManualTransferRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest); + + /** StartManualTransferRunsRequest parent. */ + public parent: string; + + /** StartManualTransferRunsRequest requestedTimeRange. */ + public requestedTimeRange?: (google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange|null); + + /** StartManualTransferRunsRequest requestedRunTime. */ + public requestedRunTime?: (google.protobuf.ITimestamp|null); + + /** StartManualTransferRunsRequest time. */ + public time?: ("requestedTimeRange"|"requestedRunTime"); + + /** + * Creates a new StartManualTransferRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartManualTransferRunsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest; + + /** + * Encodes the specified StartManualTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.verify|verify} messages. + * @param message StartManualTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartManualTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.verify|verify} messages. + * @param message StartManualTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartManualTransferRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartManualTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest; + + /** + * Decodes a StartManualTransferRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartManualTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest; + + /** + * Verifies a StartManualTransferRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartManualTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartManualTransferRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest; + + /** + * Creates a plain object from a StartManualTransferRunsRequest message. Also converts values to other types if specified. + * @param message StartManualTransferRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartManualTransferRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartManualTransferRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StartManualTransferRunsRequest { + + /** Properties of a TimeRange. */ + interface ITimeRange { + + /** TimeRange startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeRange endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimeRange. */ + class TimeRange implements ITimeRange { + + /** + * Constructs a new TimeRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange); + + /** TimeRange startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeRange endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimeRange instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeRange instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange; + + /** + * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.verify|verify} messages. + * @param message TimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.verify|verify} messages. + * @param message TimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange; + + /** + * Decodes a TimeRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange; + + /** + * Verifies a TimeRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange; + + /** + * Creates a plain object from a TimeRange message. Also converts values to other types if specified. + * @param message TimeRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a StartManualTransferRunsResponse. */ + interface IStartManualTransferRunsResponse { + + /** StartManualTransferRunsResponse runs */ + runs?: (google.cloud.bigquery.datatransfer.v1.ITransferRun[]|null); + } + + /** Represents a StartManualTransferRunsResponse. */ + class StartManualTransferRunsResponse implements IStartManualTransferRunsResponse { + + /** + * Constructs a new StartManualTransferRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse); + + /** StartManualTransferRunsResponse runs. */ + public runs: google.cloud.bigquery.datatransfer.v1.ITransferRun[]; + + /** + * Creates a new StartManualTransferRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StartManualTransferRunsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse; + + /** + * Encodes the specified StartManualTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.verify|verify} messages. + * @param message StartManualTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartManualTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.verify|verify} messages. + * @param message StartManualTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartManualTransferRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartManualTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse; + + /** + * Decodes a StartManualTransferRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartManualTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse; + + /** + * Verifies a StartManualTransferRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartManualTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartManualTransferRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse; + + /** + * Creates a plain object from a StartManualTransferRunsResponse message. Also converts values to other types if specified. + * @param message StartManualTransferRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartManualTransferRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartManualTransferRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnrollDataSourcesRequest. */ + interface IEnrollDataSourcesRequest { + + /** EnrollDataSourcesRequest name */ + name?: (string|null); + + /** EnrollDataSourcesRequest dataSourceIds */ + dataSourceIds?: (string[]|null); + } + + /** Represents an EnrollDataSourcesRequest. */ + class EnrollDataSourcesRequest implements IEnrollDataSourcesRequest { + + /** + * Constructs a new EnrollDataSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest); + + /** EnrollDataSourcesRequest name. */ + public name: string; + + /** EnrollDataSourcesRequest dataSourceIds. */ + public dataSourceIds: string[]; + + /** + * Creates a new EnrollDataSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnrollDataSourcesRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest): google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest; + + /** + * Encodes the specified EnrollDataSourcesRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest.verify|verify} messages. + * @param message EnrollDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnrollDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest.verify|verify} messages. + * @param message EnrollDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnrollDataSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnrollDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest; + + /** + * Decodes an EnrollDataSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnrollDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest; + + /** + * Verifies an EnrollDataSourcesRequest message. + * @param message Plain 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 EnrollDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnrollDataSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest; + + /** + * Creates a plain object from an EnrollDataSourcesRequest message. Also converts values to other types if specified. + * @param message EnrollDataSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnrollDataSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnrollDataSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TransferType enum. */ + enum TransferType { + TRANSFER_TYPE_UNSPECIFIED = 0, + BATCH = 1, + STREAMING = 2 + } + + /** TransferState enum. */ + enum TransferState { + TRANSFER_STATE_UNSPECIFIED = 0, + PENDING = 2, + RUNNING = 3, + SUCCEEDED = 4, + FAILED = 5, + CANCELLED = 6 + } + + /** Properties of an EmailPreferences. */ + interface IEmailPreferences { + + /** EmailPreferences enableFailureEmail */ + enableFailureEmail?: (boolean|null); + } + + /** Represents an EmailPreferences. */ + class EmailPreferences implements IEmailPreferences { + + /** + * Constructs a new EmailPreferences. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IEmailPreferences); + + /** EmailPreferences enableFailureEmail. */ + public enableFailureEmail: boolean; + + /** + * Creates a new EmailPreferences instance using the specified properties. + * @param [properties] Properties to set + * @returns EmailPreferences instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IEmailPreferences): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Encodes the specified EmailPreferences message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @param message EmailPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IEmailPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmailPreferences message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @param message EmailPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IEmailPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Verifies an EmailPreferences message. + * @param message Plain 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 EmailPreferences message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmailPreferences + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Creates a plain object from an EmailPreferences message. Also converts values to other types if specified. + * @param message EmailPreferences + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.EmailPreferences, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmailPreferences to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmailPreferences + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleOptions. */ + interface IScheduleOptions { + + /** ScheduleOptions disableAutoScheduling */ + disableAutoScheduling?: (boolean|null); + + /** ScheduleOptions startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ScheduleOptions endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ScheduleOptions. */ + class ScheduleOptions implements IScheduleOptions { + + /** + * Constructs a new ScheduleOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleOptions); + + /** ScheduleOptions disableAutoScheduling. */ + public disableAutoScheduling: boolean; + + /** ScheduleOptions startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ScheduleOptions endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ScheduleOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleOptions instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleOptions): google.cloud.bigquery.datatransfer.v1.ScheduleOptions; + + /** + * Encodes the specified ScheduleOptions message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleOptions.verify|verify} messages. + * @param message ScheduleOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IScheduleOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduleOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleOptions.verify|verify} messages. + * @param message ScheduleOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IScheduleOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduleOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ScheduleOptions; + + /** + * Decodes a ScheduleOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduleOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ScheduleOptions; + + /** + * Verifies a ScheduleOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScheduleOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduleOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ScheduleOptions; + + /** + * Creates a plain object from a ScheduleOptions message. Also converts values to other types if specified. + * @param message ScheduleOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ScheduleOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduleOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScheduleOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserInfo. */ + interface IUserInfo { + + /** UserInfo email */ + email?: (string|null); + } + + /** Represents a UserInfo. */ + class UserInfo implements IUserInfo { + + /** + * Constructs a new UserInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IUserInfo); + + /** UserInfo email. */ + public email?: (string|null); + + /** UserInfo _email. */ + public _email?: "email"; + + /** + * Creates a new UserInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns UserInfo instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IUserInfo): google.cloud.bigquery.datatransfer.v1.UserInfo; + + /** + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.UserInfo; + + /** + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.UserInfo; + + /** + * Verifies a UserInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.UserInfo; + + /** + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @param message UserInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferConfig. */ + interface ITransferConfig { + + /** TransferConfig name */ + name?: (string|null); + + /** TransferConfig destinationDatasetId */ + destinationDatasetId?: (string|null); + + /** TransferConfig displayName */ + displayName?: (string|null); + + /** TransferConfig dataSourceId */ + dataSourceId?: (string|null); + + /** TransferConfig params */ + params?: (google.protobuf.IStruct|null); + + /** TransferConfig schedule */ + schedule?: (string|null); + + /** TransferConfig scheduleOptions */ + scheduleOptions?: (google.cloud.bigquery.datatransfer.v1.IScheduleOptions|null); + + /** TransferConfig dataRefreshWindowDays */ + dataRefreshWindowDays?: (number|null); + + /** TransferConfig disabled */ + disabled?: (boolean|null); + + /** TransferConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TransferConfig nextRunTime */ + nextRunTime?: (google.protobuf.ITimestamp|null); + + /** TransferConfig state */ + state?: (google.cloud.bigquery.datatransfer.v1.TransferState|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferState|null); + + /** TransferConfig userId */ + userId?: (number|Long|string|null); + + /** TransferConfig datasetRegion */ + datasetRegion?: (string|null); + + /** TransferConfig notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); + + /** TransferConfig emailPreferences */ + emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); + + /** TransferConfig ownerInfo */ + ownerInfo?: (google.cloud.bigquery.datatransfer.v1.IUserInfo|null); + } + + /** Represents a TransferConfig. */ + class TransferConfig implements ITransferConfig { + + /** + * Constructs a new TransferConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ITransferConfig); + + /** TransferConfig name. */ + public name: string; + + /** TransferConfig destinationDatasetId. */ + public destinationDatasetId?: (string|null); + + /** TransferConfig displayName. */ + public displayName: string; + + /** TransferConfig dataSourceId. */ + public dataSourceId: string; + + /** TransferConfig params. */ + public params?: (google.protobuf.IStruct|null); + + /** TransferConfig schedule. */ + public schedule: string; + + /** TransferConfig scheduleOptions. */ + public scheduleOptions?: (google.cloud.bigquery.datatransfer.v1.IScheduleOptions|null); + + /** TransferConfig dataRefreshWindowDays. */ + public dataRefreshWindowDays: number; + + /** TransferConfig disabled. */ + public disabled: boolean; + + /** TransferConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TransferConfig nextRunTime. */ + public nextRunTime?: (google.protobuf.ITimestamp|null); + + /** TransferConfig state. */ + public state: (google.cloud.bigquery.datatransfer.v1.TransferState|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferState); + + /** TransferConfig userId. */ + public userId: (number|Long|string); + + /** TransferConfig datasetRegion. */ + public datasetRegion: string; + + /** TransferConfig notificationPubsubTopic. */ + public notificationPubsubTopic: string; + + /** TransferConfig emailPreferences. */ + public emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); + + /** TransferConfig ownerInfo. */ + public ownerInfo?: (google.cloud.bigquery.datatransfer.v1.IUserInfo|null); + + /** TransferConfig destination. */ + public destination?: "destinationDatasetId"; + + /** TransferConfig _ownerInfo. */ + public _ownerInfo?: "ownerInfo"; + + /** + * Creates a new TransferConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferConfig instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ITransferConfig): google.cloud.bigquery.datatransfer.v1.TransferConfig; + + /** + * Encodes the specified TransferConfig message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferConfig.verify|verify} messages. + * @param message TransferConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ITransferConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferConfig message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferConfig.verify|verify} messages. + * @param message TransferConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ITransferConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.TransferConfig; + + /** + * Decodes a TransferConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.TransferConfig; + + /** + * Verifies a TransferConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.TransferConfig; + + /** + * Creates a plain object from a TransferConfig message. Also converts values to other types if specified. + * @param message TransferConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.TransferConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferRun. */ + interface ITransferRun { + + /** TransferRun name */ + name?: (string|null); + + /** TransferRun scheduleTime */ + scheduleTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun runTime */ + runTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun errorStatus */ + errorStatus?: (google.rpc.IStatus|null); + + /** TransferRun startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun params */ + params?: (google.protobuf.IStruct|null); + + /** TransferRun destinationDatasetId */ + destinationDatasetId?: (string|null); + + /** TransferRun dataSourceId */ + dataSourceId?: (string|null); + + /** TransferRun state */ + state?: (google.cloud.bigquery.datatransfer.v1.TransferState|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferState|null); + + /** TransferRun userId */ + userId?: (number|Long|string|null); + + /** TransferRun schedule */ + schedule?: (string|null); + + /** TransferRun notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); + + /** TransferRun emailPreferences */ + emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); + } + + /** Represents a TransferRun. */ + class TransferRun implements ITransferRun { + + /** + * Constructs a new TransferRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ITransferRun); + + /** TransferRun name. */ + public name: string; + + /** TransferRun scheduleTime. */ + public scheduleTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun runTime. */ + public runTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun errorStatus. */ + public errorStatus?: (google.rpc.IStatus|null); + + /** TransferRun startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun params. */ + public params?: (google.protobuf.IStruct|null); + + /** TransferRun destinationDatasetId. */ + public destinationDatasetId?: (string|null); + + /** TransferRun dataSourceId. */ + public dataSourceId: string; + + /** TransferRun state. */ + public state: (google.cloud.bigquery.datatransfer.v1.TransferState|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferState); + + /** TransferRun userId. */ + public userId: (number|Long|string); + + /** TransferRun schedule. */ + public schedule: string; + + /** TransferRun notificationPubsubTopic. */ + public notificationPubsubTopic: string; + + /** TransferRun emailPreferences. */ + public emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); + + /** TransferRun destination. */ + public destination?: "destinationDatasetId"; + + /** + * Creates a new TransferRun instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferRun instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ITransferRun): google.cloud.bigquery.datatransfer.v1.TransferRun; + + /** + * Encodes the specified TransferRun message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferRun.verify|verify} messages. + * @param message TransferRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ITransferRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferRun message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferRun.verify|verify} messages. + * @param message TransferRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ITransferRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.TransferRun; + + /** + * Decodes a TransferRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.TransferRun; + + /** + * Verifies a TransferRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.TransferRun; + + /** + * Creates a plain object from a TransferRun message. Also converts values to other types if specified. + * @param message TransferRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.TransferRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferMessage. */ + interface ITransferMessage { + + /** TransferMessage messageTime */ + messageTime?: (google.protobuf.ITimestamp|null); + + /** TransferMessage severity */ + severity?: (google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity|null); + + /** TransferMessage messageText */ + messageText?: (string|null); + } + + /** Represents a TransferMessage. */ + class TransferMessage implements ITransferMessage { + + /** + * Constructs a new TransferMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ITransferMessage); + + /** TransferMessage messageTime. */ + public messageTime?: (google.protobuf.ITimestamp|null); + + /** TransferMessage severity. */ + public severity: (google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity); + + /** TransferMessage messageText. */ + public messageText: string; + + /** + * Creates a new TransferMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferMessage instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ITransferMessage): google.cloud.bigquery.datatransfer.v1.TransferMessage; + + /** + * Encodes the specified TransferMessage message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferMessage.verify|verify} messages. + * @param message TransferMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ITransferMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferMessage message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferMessage.verify|verify} messages. + * @param message TransferMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ITransferMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.TransferMessage; + + /** + * Decodes a TransferMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.TransferMessage; + + /** + * Verifies a TransferMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.TransferMessage; + + /** + * Creates a plain object from a TransferMessage message. Also converts values to other types if specified. + * @param message TransferMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.TransferMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransferMessage { + + /** MessageSeverity enum. */ + enum MessageSeverity { + MESSAGE_SEVERITY_UNSPECIFIED = 0, + INFO = 1, + WARNING = 2, + ERROR = 3 + } + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.js b/packages/google-cloud-bigquery-datatransfer/protos/protos.js new file mode 100644 index 00000000000..6267625dcfc --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.js @@ -0,0 +1,25230 @@ +// 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_bigquery_data_transfer_protos || ($protobuf.roots._google_cloud_bigquery_data_transfer_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.bigquery = (function() { + + /** + * Namespace bigquery. + * @memberof google.cloud + * @namespace + */ + var bigquery = {}; + + bigquery.datatransfer = (function() { + + /** + * Namespace datatransfer. + * @memberof google.cloud.bigquery + * @namespace + */ + var datatransfer = {}; + + datatransfer.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.bigquery.datatransfer + * @namespace + */ + var v1 = {}; + + v1.DataTransferService = (function() { + + /** + * Constructs a new DataTransferService service. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a DataTransferService + * @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 DataTransferService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DataTransferService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DataTransferService; + + /** + * Creates new DataTransferService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @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 {DataTransferService} RPC service. Useful where requests and/or responses are streamed. + */ + DataTransferService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getDataSource}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef GetDataSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.DataSource} [response] DataSource + */ + + /** + * Calls GetDataSource. + * @function getDataSource + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.GetDataSourceCallback} callback Node-style callback called with the error, if any, and DataSource + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.getDataSource = function getDataSource(request, callback) { + return this.rpcCall(getDataSource, $root.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest, $root.google.cloud.bigquery.datatransfer.v1.DataSource, request, callback); + }, "name", { value: "GetDataSource" }); + + /** + * Calls GetDataSource. + * @function getDataSource + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listDataSources}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef ListDataSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} [response] ListDataSourcesResponse + */ + + /** + * Calls ListDataSources. + * @function listDataSources + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.ListDataSourcesCallback} callback Node-style callback called with the error, if any, and ListDataSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.listDataSources = function listDataSources(request, callback) { + return this.rpcCall(listDataSources, $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest, $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse, request, callback); + }, "name", { value: "ListDataSources" }); + + /** + * Calls ListDataSources. + * @function listDataSources + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|createTransferConfig}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef CreateTransferConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} [response] TransferConfig + */ + + /** + * Calls CreateTransferConfig. + * @function createTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest} request CreateTransferConfigRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.CreateTransferConfigCallback} callback Node-style callback called with the error, if any, and TransferConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.createTransferConfig = function createTransferConfig(request, callback) { + return this.rpcCall(createTransferConfig, $root.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest, $root.google.cloud.bigquery.datatransfer.v1.TransferConfig, request, callback); + }, "name", { value: "CreateTransferConfig" }); + + /** + * Calls CreateTransferConfig. + * @function createTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest} request CreateTransferConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|updateTransferConfig}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef UpdateTransferConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} [response] TransferConfig + */ + + /** + * Calls UpdateTransferConfig. + * @function updateTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest} request UpdateTransferConfigRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.UpdateTransferConfigCallback} callback Node-style callback called with the error, if any, and TransferConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.updateTransferConfig = function updateTransferConfig(request, callback) { + return this.rpcCall(updateTransferConfig, $root.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest, $root.google.cloud.bigquery.datatransfer.v1.TransferConfig, request, callback); + }, "name", { value: "UpdateTransferConfig" }); + + /** + * Calls UpdateTransferConfig. + * @function updateTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest} request UpdateTransferConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|deleteTransferConfig}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef DeleteTransferConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTransferConfig. + * @function deleteTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest} request DeleteTransferConfigRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.deleteTransferConfig = function deleteTransferConfig(request, callback) { + return this.rpcCall(deleteTransferConfig, $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTransferConfig" }); + + /** + * Calls DeleteTransferConfig. + * @function deleteTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest} request DeleteTransferConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getTransferConfig}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef GetTransferConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} [response] TransferConfig + */ + + /** + * Calls GetTransferConfig. + * @function getTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest} request GetTransferConfigRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferConfigCallback} callback Node-style callback called with the error, if any, and TransferConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.getTransferConfig = function getTransferConfig(request, callback) { + return this.rpcCall(getTransferConfig, $root.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest, $root.google.cloud.bigquery.datatransfer.v1.TransferConfig, request, callback); + }, "name", { value: "GetTransferConfig" }); + + /** + * Calls GetTransferConfig. + * @function getTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest} request GetTransferConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferConfigs}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef ListTransferConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} [response] ListTransferConfigsResponse + */ + + /** + * Calls ListTransferConfigs. + * @function listTransferConfigs + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest} request ListTransferConfigsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferConfigsCallback} callback Node-style callback called with the error, if any, and ListTransferConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.listTransferConfigs = function listTransferConfigs(request, callback) { + return this.rpcCall(listTransferConfigs, $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest, $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse, request, callback); + }, "name", { value: "ListTransferConfigs" }); + + /** + * Calls ListTransferConfigs. + * @function listTransferConfigs + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest} request ListTransferConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|scheduleTransferRuns}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef ScheduleTransferRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} [response] ScheduleTransferRunsResponse + */ + + /** + * Calls ScheduleTransferRuns. + * @function scheduleTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest} request ScheduleTransferRunsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.ScheduleTransferRunsCallback} callback Node-style callback called with the error, if any, and ScheduleTransferRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.scheduleTransferRuns = function scheduleTransferRuns(request, callback) { + return this.rpcCall(scheduleTransferRuns, $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest, $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse, request, callback); + }, "name", { value: "ScheduleTransferRuns" }); + + /** + * Calls ScheduleTransferRuns. + * @function scheduleTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest} request ScheduleTransferRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|startManualTransferRuns}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef StartManualTransferRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} [response] StartManualTransferRunsResponse + */ + + /** + * Calls StartManualTransferRuns. + * @function startManualTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest} request StartManualTransferRunsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.StartManualTransferRunsCallback} callback Node-style callback called with the error, if any, and StartManualTransferRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.startManualTransferRuns = function startManualTransferRuns(request, callback) { + return this.rpcCall(startManualTransferRuns, $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest, $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse, request, callback); + }, "name", { value: "StartManualTransferRuns" }); + + /** + * Calls StartManualTransferRuns. + * @function startManualTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest} request StartManualTransferRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getTransferRun}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef GetTransferRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.TransferRun} [response] TransferRun + */ + + /** + * Calls GetTransferRun. + * @function getTransferRun + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest} request GetTransferRunRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferRunCallback} callback Node-style callback called with the error, if any, and TransferRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.getTransferRun = function getTransferRun(request, callback) { + return this.rpcCall(getTransferRun, $root.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest, $root.google.cloud.bigquery.datatransfer.v1.TransferRun, request, callback); + }, "name", { value: "GetTransferRun" }); + + /** + * Calls GetTransferRun. + * @function getTransferRun + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest} request GetTransferRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|deleteTransferRun}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef DeleteTransferRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTransferRun. + * @function deleteTransferRun + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest} request DeleteTransferRunRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferRunCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.deleteTransferRun = function deleteTransferRun(request, callback) { + return this.rpcCall(deleteTransferRun, $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTransferRun" }); + + /** + * Calls DeleteTransferRun. + * @function deleteTransferRun + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest} request DeleteTransferRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferRuns}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef ListTransferRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} [response] ListTransferRunsResponse + */ + + /** + * Calls ListTransferRuns. + * @function listTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest} request ListTransferRunsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferRunsCallback} callback Node-style callback called with the error, if any, and ListTransferRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.listTransferRuns = function listTransferRuns(request, callback) { + return this.rpcCall(listTransferRuns, $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest, $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse, request, callback); + }, "name", { value: "ListTransferRuns" }); + + /** + * Calls ListTransferRuns. + * @function listTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest} request ListTransferRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferLogs}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef ListTransferLogsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} [response] ListTransferLogsResponse + */ + + /** + * Calls ListTransferLogs. + * @function listTransferLogs + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest} request ListTransferLogsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferLogsCallback} callback Node-style callback called with the error, if any, and ListTransferLogsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.listTransferLogs = function listTransferLogs(request, callback) { + return this.rpcCall(listTransferLogs, $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest, $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse, request, callback); + }, "name", { value: "ListTransferLogs" }); + + /** + * Calls ListTransferLogs. + * @function listTransferLogs + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest} request ListTransferLogsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|checkValidCreds}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef CheckValidCredsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} [response] CheckValidCredsResponse + */ + + /** + * Calls CheckValidCreds. + * @function checkValidCreds + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest} request CheckValidCredsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.CheckValidCredsCallback} callback Node-style callback called with the error, if any, and CheckValidCredsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.checkValidCreds = function checkValidCreds(request, callback) { + return this.rpcCall(checkValidCreds, $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest, $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse, request, callback); + }, "name", { value: "CheckValidCreds" }); + + /** + * Calls CheckValidCreds. + * @function checkValidCreds + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest} request CheckValidCredsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|enrollDataSources}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef EnrollDataSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls EnrollDataSources. + * @function enrollDataSources + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest} request EnrollDataSourcesRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.EnrollDataSourcesCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.enrollDataSources = function enrollDataSources(request, callback) { + return this.rpcCall(enrollDataSources, $root.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "EnrollDataSources" }); + + /** + * Calls EnrollDataSources. + * @function enrollDataSources + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest} request EnrollDataSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DataTransferService; + })(); + + v1.DataSourceParameter = (function() { + + /** + * Properties of a DataSourceParameter. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IDataSourceParameter + * @property {string|null} [paramId] DataSourceParameter paramId + * @property {string|null} [displayName] DataSourceParameter displayName + * @property {string|null} [description] DataSourceParameter description + * @property {google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type|null} [type] DataSourceParameter type + * @property {boolean|null} [required] DataSourceParameter required + * @property {boolean|null} [repeated] DataSourceParameter repeated + * @property {string|null} [validationRegex] DataSourceParameter validationRegex + * @property {Array.|null} [allowedValues] DataSourceParameter allowedValues + * @property {google.protobuf.IDoubleValue|null} [minValue] DataSourceParameter minValue + * @property {google.protobuf.IDoubleValue|null} [maxValue] DataSourceParameter maxValue + * @property {Array.|null} [fields] DataSourceParameter fields + * @property {string|null} [validationDescription] DataSourceParameter validationDescription + * @property {string|null} [validationHelpUrl] DataSourceParameter validationHelpUrl + * @property {boolean|null} [immutable] DataSourceParameter immutable + * @property {boolean|null} [recurse] DataSourceParameter recurse + * @property {boolean|null} [deprecated] DataSourceParameter deprecated + */ + + /** + * Constructs a new DataSourceParameter. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a DataSourceParameter. + * @implements IDataSourceParameter + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IDataSourceParameter=} [properties] Properties to set + */ + function DataSourceParameter(properties) { + this.allowedValues = []; + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSourceParameter paramId. + * @member {string} paramId + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.paramId = ""; + + /** + * DataSourceParameter displayName. + * @member {string} displayName + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.displayName = ""; + + /** + * DataSourceParameter description. + * @member {string} description + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.description = ""; + + /** + * DataSourceParameter type. + * @member {google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type} type + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.type = 0; + + /** + * DataSourceParameter required. + * @member {boolean} required + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.required = false; + + /** + * DataSourceParameter repeated. + * @member {boolean} repeated + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.repeated = false; + + /** + * DataSourceParameter validationRegex. + * @member {string} validationRegex + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.validationRegex = ""; + + /** + * DataSourceParameter allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.allowedValues = $util.emptyArray; + + /** + * DataSourceParameter minValue. + * @member {google.protobuf.IDoubleValue|null|undefined} minValue + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.minValue = null; + + /** + * DataSourceParameter maxValue. + * @member {google.protobuf.IDoubleValue|null|undefined} maxValue + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.maxValue = null; + + /** + * DataSourceParameter fields. + * @member {Array.} fields + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.fields = $util.emptyArray; + + /** + * DataSourceParameter validationDescription. + * @member {string} validationDescription + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.validationDescription = ""; + + /** + * DataSourceParameter validationHelpUrl. + * @member {string} validationHelpUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.validationHelpUrl = ""; + + /** + * DataSourceParameter immutable. + * @member {boolean} immutable + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.immutable = false; + + /** + * DataSourceParameter recurse. + * @member {boolean} recurse + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.recurse = false; + + /** + * DataSourceParameter deprecated. + * @member {boolean} deprecated + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.deprecated = false; + + /** + * Creates a new DataSourceParameter instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSourceParameter=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.DataSourceParameter} DataSourceParameter instance + */ + DataSourceParameter.create = function create(properties) { + return new DataSourceParameter(properties); + }; + + /** + * Encodes the specified DataSourceParameter message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSourceParameter} message DataSourceParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paramId != null && Object.hasOwnProperty.call(message, "paramId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paramId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + if (message.required != null && Object.hasOwnProperty.call(message, "required")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.required); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + if (message.validationRegex != null && Object.hasOwnProperty.call(message, "validationRegex")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.validationRegex); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.allowedValues[i]); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + $root.google.protobuf.DoubleValue.encode(message.minValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + $root.google.protobuf.DoubleValue.encode(message.maxValue, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.encode(message.fields[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.validationDescription != null && Object.hasOwnProperty.call(message, "validationDescription")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.validationDescription); + if (message.validationHelpUrl != null && Object.hasOwnProperty.call(message, "validationHelpUrl")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.validationHelpUrl); + if (message.immutable != null && Object.hasOwnProperty.call(message, "immutable")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.immutable); + if (message.recurse != null && Object.hasOwnProperty.call(message, "recurse")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.recurse); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.deprecated); + return writer; + }; + + /** + * Encodes the specified DataSourceParameter message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSourceParameter} message DataSourceParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSourceParameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.DataSourceParameter} DataSourceParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceParameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.paramId = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.type = reader.int32(); + break; + } + case 5: { + message.required = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + case 7: { + message.validationRegex = reader.string(); + break; + } + case 8: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + case 9: { + message.minValue = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32()); + break; + } + case 10: { + message.maxValue = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.decode(reader, reader.uint32())); + break; + } + case 12: { + message.validationDescription = reader.string(); + break; + } + case 13: { + message.validationHelpUrl = reader.string(); + break; + } + case 14: { + message.immutable = reader.bool(); + break; + } + case 15: { + message.recurse = reader.bool(); + break; + } + case 20: { + message.deprecated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSourceParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.DataSourceParameter} DataSourceParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSourceParameter message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSourceParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paramId != null && message.hasOwnProperty("paramId")) + if (!$util.isString(message.paramId)) + return "paramId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.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.required != null && message.hasOwnProperty("required")) + if (typeof message.required !== "boolean") + return "required: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + if (message.validationRegex != null && message.hasOwnProperty("validationRegex")) + if (!$util.isString(message.validationRegex)) + return "validationRegex: string expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) { + var error = $root.google.protobuf.DoubleValue.verify(message.minValue); + if (error) + return "minValue." + error; + } + if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + var error = $root.google.protobuf.DoubleValue.verify(message.maxValue); + if (error) + return "maxValue." + error; + } + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + if (message.validationDescription != null && message.hasOwnProperty("validationDescription")) + if (!$util.isString(message.validationDescription)) + return "validationDescription: string expected"; + if (message.validationHelpUrl != null && message.hasOwnProperty("validationHelpUrl")) + if (!$util.isString(message.validationHelpUrl)) + return "validationHelpUrl: string expected"; + if (message.immutable != null && message.hasOwnProperty("immutable")) + if (typeof message.immutable !== "boolean") + return "immutable: boolean expected"; + if (message.recurse != null && message.hasOwnProperty("recurse")) + if (typeof message.recurse !== "boolean") + return "recurse: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + return null; + }; + + /** + * Creates a DataSourceParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.DataSourceParameter} DataSourceParameter + */ + DataSourceParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter(); + if (object.paramId != null) + message.paramId = String(object.paramId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STRING": + case 1: + message.type = 1; + break; + case "INTEGER": + case 2: + message.type = 2; + break; + case "DOUBLE": + case 3: + message.type = 3; + break; + case "BOOLEAN": + case 4: + message.type = 4; + break; + case "RECORD": + case 5: + message.type = 5; + break; + case "PLUS_PAGE": + case 6: + message.type = 6; + break; + } + if (object.required != null) + message.required = Boolean(object.required); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + if (object.validationRegex != null) + message.validationRegex = String(object.validationRegex); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSourceParameter.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + if (object.minValue != null) { + if (typeof object.minValue !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSourceParameter.minValue: object expected"); + message.minValue = $root.google.protobuf.DoubleValue.fromObject(object.minValue); + } + if (object.maxValue != null) { + if (typeof object.maxValue !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSourceParameter.maxValue: object expected"); + message.maxValue = $root.google.protobuf.DoubleValue.fromObject(object.maxValue); + } + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSourceParameter.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSourceParameter.fields: object expected"); + message.fields[i] = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.fromObject(object.fields[i]); + } + } + if (object.validationDescription != null) + message.validationDescription = String(object.validationDescription); + if (object.validationHelpUrl != null) + message.validationHelpUrl = String(object.validationHelpUrl); + if (object.immutable != null) + message.immutable = Boolean(object.immutable); + if (object.recurse != null) + message.recurse = Boolean(object.recurse); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + return message; + }; + + /** + * Creates a plain object from a DataSourceParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {google.cloud.bigquery.datatransfer.v1.DataSourceParameter} message DataSourceParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSourceParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedValues = []; + object.fields = []; + } + if (options.defaults) { + object.paramId = ""; + object.displayName = ""; + object.description = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.required = false; + object.repeated = false; + object.validationRegex = ""; + object.minValue = null; + object.maxValue = null; + object.validationDescription = ""; + object.validationHelpUrl = ""; + object.immutable = false; + object.recurse = false; + object.deprecated = false; + } + if (message.paramId != null && message.hasOwnProperty("paramId")) + object.paramId = message.paramId; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type[message.type] : message.type; + if (message.required != null && message.hasOwnProperty("required")) + object.required = message.required; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + if (message.validationRegex != null && message.hasOwnProperty("validationRegex")) + object.validationRegex = message.validationRegex; + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = $root.google.protobuf.DoubleValue.toObject(message.minValue, options); + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = $root.google.protobuf.DoubleValue.toObject(message.maxValue, options); + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.toObject(message.fields[j], options); + } + if (message.validationDescription != null && message.hasOwnProperty("validationDescription")) + object.validationDescription = message.validationDescription; + if (message.validationHelpUrl != null && message.hasOwnProperty("validationHelpUrl")) + object.validationHelpUrl = message.validationHelpUrl; + if (message.immutable != null && message.hasOwnProperty("immutable")) + object.immutable = message.immutable; + if (message.recurse != null && message.hasOwnProperty("recurse")) + object.recurse = message.recurse; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + return object; + }; + + /** + * Converts this DataSourceParameter to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + * @returns {Object.} JSON object + */ + DataSourceParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSourceParameter + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSourceParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.DataSourceParameter"; + }; + + /** + * Type enum. + * @name google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INTEGER=2 INTEGER value + * @property {number} DOUBLE=3 DOUBLE value + * @property {number} BOOLEAN=4 BOOLEAN value + * @property {number} RECORD=5 RECORD value + * @property {number} PLUS_PAGE=6 PLUS_PAGE value + */ + DataSourceParameter.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INTEGER"] = 2; + values[valuesById[3] = "DOUBLE"] = 3; + values[valuesById[4] = "BOOLEAN"] = 4; + values[valuesById[5] = "RECORD"] = 5; + values[valuesById[6] = "PLUS_PAGE"] = 6; + return values; + })(); + + return DataSourceParameter; + })(); + + v1.DataSource = (function() { + + /** + * Properties of a DataSource. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IDataSource + * @property {string|null} [name] DataSource name + * @property {string|null} [dataSourceId] DataSource dataSourceId + * @property {string|null} [displayName] DataSource displayName + * @property {string|null} [description] DataSource description + * @property {string|null} [clientId] DataSource clientId + * @property {Array.|null} [scopes] DataSource scopes + * @property {google.cloud.bigquery.datatransfer.v1.TransferType|null} [transferType] DataSource transferType + * @property {boolean|null} [supportsMultipleTransfers] DataSource supportsMultipleTransfers + * @property {number|null} [updateDeadlineSeconds] DataSource updateDeadlineSeconds + * @property {string|null} [defaultSchedule] DataSource defaultSchedule + * @property {boolean|null} [supportsCustomSchedule] DataSource supportsCustomSchedule + * @property {Array.|null} [parameters] DataSource parameters + * @property {string|null} [helpUrl] DataSource helpUrl + * @property {google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType|null} [authorizationType] DataSource authorizationType + * @property {google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType|null} [dataRefreshType] DataSource dataRefreshType + * @property {number|null} [defaultDataRefreshWindowDays] DataSource defaultDataRefreshWindowDays + * @property {boolean|null} [manualRunsDisabled] DataSource manualRunsDisabled + * @property {google.protobuf.IDuration|null} [minimumScheduleInterval] DataSource minimumScheduleInterval + */ + + /** + * Constructs a new DataSource. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a DataSource. + * @implements IDataSource + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IDataSource=} [properties] Properties to set + */ + function DataSource(properties) { + this.scopes = []; + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSource name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.name = ""; + + /** + * DataSource dataSourceId. + * @member {string} dataSourceId + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.dataSourceId = ""; + + /** + * DataSource displayName. + * @member {string} displayName + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.displayName = ""; + + /** + * DataSource description. + * @member {string} description + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.description = ""; + + /** + * DataSource clientId. + * @member {string} clientId + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.clientId = ""; + + /** + * DataSource scopes. + * @member {Array.} scopes + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.scopes = $util.emptyArray; + + /** + * DataSource transferType. + * @member {google.cloud.bigquery.datatransfer.v1.TransferType} transferType + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.transferType = 0; + + /** + * DataSource supportsMultipleTransfers. + * @member {boolean} supportsMultipleTransfers + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.supportsMultipleTransfers = false; + + /** + * DataSource updateDeadlineSeconds. + * @member {number} updateDeadlineSeconds + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.updateDeadlineSeconds = 0; + + /** + * DataSource defaultSchedule. + * @member {string} defaultSchedule + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.defaultSchedule = ""; + + /** + * DataSource supportsCustomSchedule. + * @member {boolean} supportsCustomSchedule + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.supportsCustomSchedule = false; + + /** + * DataSource parameters. + * @member {Array.} parameters + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.parameters = $util.emptyArray; + + /** + * DataSource helpUrl. + * @member {string} helpUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.helpUrl = ""; + + /** + * DataSource authorizationType. + * @member {google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType} authorizationType + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.authorizationType = 0; + + /** + * DataSource dataRefreshType. + * @member {google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType} dataRefreshType + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.dataRefreshType = 0; + + /** + * DataSource defaultDataRefreshWindowDays. + * @member {number} defaultDataRefreshWindowDays + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.defaultDataRefreshWindowDays = 0; + + /** + * DataSource manualRunsDisabled. + * @member {boolean} manualRunsDisabled + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.manualRunsDisabled = false; + + /** + * DataSource minimumScheduleInterval. + * @member {google.protobuf.IDuration|null|undefined} minimumScheduleInterval + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.minimumScheduleInterval = null; + + /** + * Creates a new DataSource instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSource=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.DataSource} DataSource instance + */ + DataSource.create = function create(properties) { + return new DataSource(properties); + }; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.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.dataSourceId != null && Object.hasOwnProperty.call(message, "dataSourceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSourceId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.clientId); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.scopes[i]); + if (message.transferType != null && Object.hasOwnProperty.call(message, "transferType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.transferType); + if (message.supportsMultipleTransfers != null && Object.hasOwnProperty.call(message, "supportsMultipleTransfers")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.supportsMultipleTransfers); + if (message.updateDeadlineSeconds != null && Object.hasOwnProperty.call(message, "updateDeadlineSeconds")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.updateDeadlineSeconds); + if (message.defaultSchedule != null && Object.hasOwnProperty.call(message, "defaultSchedule")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.defaultSchedule); + if (message.supportsCustomSchedule != null && Object.hasOwnProperty.call(message, "supportsCustomSchedule")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.supportsCustomSchedule); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.encode(message.parameters[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.helpUrl != null && Object.hasOwnProperty.call(message, "helpUrl")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.helpUrl); + if (message.authorizationType != null && Object.hasOwnProperty.call(message, "authorizationType")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.authorizationType); + if (message.dataRefreshType != null && Object.hasOwnProperty.call(message, "dataRefreshType")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.dataRefreshType); + if (message.defaultDataRefreshWindowDays != null && Object.hasOwnProperty.call(message, "defaultDataRefreshWindowDays")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.defaultDataRefreshWindowDays); + if (message.manualRunsDisabled != null && Object.hasOwnProperty.call(message, "manualRunsDisabled")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.manualRunsDisabled); + if (message.minimumScheduleInterval != null && Object.hasOwnProperty.call(message, "minimumScheduleInterval")) + $root.google.protobuf.Duration.encode(message.minimumScheduleInterval, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.DataSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dataSourceId = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.clientId = reader.string(); + break; + } + case 6: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + case 7: { + message.transferType = reader.int32(); + break; + } + case 8: { + message.supportsMultipleTransfers = reader.bool(); + break; + } + case 9: { + message.updateDeadlineSeconds = reader.int32(); + break; + } + case 10: { + message.defaultSchedule = reader.string(); + break; + } + case 11: { + message.supportsCustomSchedule = reader.bool(); + break; + } + case 12: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.decode(reader, reader.uint32())); + break; + } + case 13: { + message.helpUrl = reader.string(); + break; + } + case 14: { + message.authorizationType = reader.int32(); + break; + } + case 15: { + message.dataRefreshType = reader.int32(); + break; + } + case 16: { + message.defaultDataRefreshWindowDays = reader.int32(); + break; + } + case 17: { + message.manualRunsDisabled = reader.bool(); + break; + } + case 18: { + message.minimumScheduleInterval = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSource message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSource.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.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + if (!$util.isString(message.dataSourceId)) + return "dataSourceId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + if (message.transferType != null && message.hasOwnProperty("transferType")) + switch (message.transferType) { + default: + return "transferType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.supportsMultipleTransfers != null && message.hasOwnProperty("supportsMultipleTransfers")) + if (typeof message.supportsMultipleTransfers !== "boolean") + return "supportsMultipleTransfers: boolean expected"; + if (message.updateDeadlineSeconds != null && message.hasOwnProperty("updateDeadlineSeconds")) + if (!$util.isInteger(message.updateDeadlineSeconds)) + return "updateDeadlineSeconds: integer expected"; + if (message.defaultSchedule != null && message.hasOwnProperty("defaultSchedule")) + if (!$util.isString(message.defaultSchedule)) + return "defaultSchedule: string expected"; + if (message.supportsCustomSchedule != null && message.hasOwnProperty("supportsCustomSchedule")) + if (typeof message.supportsCustomSchedule !== "boolean") + return "supportsCustomSchedule: boolean expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + if (message.helpUrl != null && message.hasOwnProperty("helpUrl")) + if (!$util.isString(message.helpUrl)) + return "helpUrl: string expected"; + if (message.authorizationType != null && message.hasOwnProperty("authorizationType")) + switch (message.authorizationType) { + default: + return "authorizationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.dataRefreshType != null && message.hasOwnProperty("dataRefreshType")) + switch (message.dataRefreshType) { + default: + return "dataRefreshType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultDataRefreshWindowDays != null && message.hasOwnProperty("defaultDataRefreshWindowDays")) + if (!$util.isInteger(message.defaultDataRefreshWindowDays)) + return "defaultDataRefreshWindowDays: integer expected"; + if (message.manualRunsDisabled != null && message.hasOwnProperty("manualRunsDisabled")) + if (typeof message.manualRunsDisabled !== "boolean") + return "manualRunsDisabled: boolean expected"; + if (message.minimumScheduleInterval != null && message.hasOwnProperty("minimumScheduleInterval")) { + var error = $root.google.protobuf.Duration.verify(message.minimumScheduleInterval); + if (error) + return "minimumScheduleInterval." + error; + } + return null; + }; + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.DataSource} DataSource + */ + DataSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.DataSource) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.DataSource(); + if (object.name != null) + message.name = String(object.name); + if (object.dataSourceId != null) + message.dataSourceId = String(object.dataSourceId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSource.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + switch (object.transferType) { + case "TRANSFER_TYPE_UNSPECIFIED": + case 0: + message.transferType = 0; + break; + case "BATCH": + case 1: + message.transferType = 1; + break; + case "STREAMING": + case 2: + message.transferType = 2; + break; + } + if (object.supportsMultipleTransfers != null) + message.supportsMultipleTransfers = Boolean(object.supportsMultipleTransfers); + if (object.updateDeadlineSeconds != null) + message.updateDeadlineSeconds = object.updateDeadlineSeconds | 0; + if (object.defaultSchedule != null) + message.defaultSchedule = String(object.defaultSchedule); + if (object.supportsCustomSchedule != null) + message.supportsCustomSchedule = Boolean(object.supportsCustomSchedule); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSource.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSource.parameters: object expected"); + message.parameters[i] = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.fromObject(object.parameters[i]); + } + } + if (object.helpUrl != null) + message.helpUrl = String(object.helpUrl); + switch (object.authorizationType) { + case "AUTHORIZATION_TYPE_UNSPECIFIED": + case 0: + message.authorizationType = 0; + break; + case "AUTHORIZATION_CODE": + case 1: + message.authorizationType = 1; + break; + case "GOOGLE_PLUS_AUTHORIZATION_CODE": + case 2: + message.authorizationType = 2; + break; + case "FIRST_PARTY_OAUTH": + case 3: + message.authorizationType = 3; + break; + } + switch (object.dataRefreshType) { + case "DATA_REFRESH_TYPE_UNSPECIFIED": + case 0: + message.dataRefreshType = 0; + break; + case "SLIDING_WINDOW": + case 1: + message.dataRefreshType = 1; + break; + case "CUSTOM_SLIDING_WINDOW": + case 2: + message.dataRefreshType = 2; + break; + } + if (object.defaultDataRefreshWindowDays != null) + message.defaultDataRefreshWindowDays = object.defaultDataRefreshWindowDays | 0; + if (object.manualRunsDisabled != null) + message.manualRunsDisabled = Boolean(object.manualRunsDisabled); + if (object.minimumScheduleInterval != null) { + if (typeof object.minimumScheduleInterval !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSource.minimumScheduleInterval: object expected"); + message.minimumScheduleInterval = $root.google.protobuf.Duration.fromObject(object.minimumScheduleInterval); + } + return message; + }; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {google.cloud.bigquery.datatransfer.v1.DataSource} message DataSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.scopes = []; + object.parameters = []; + } + if (options.defaults) { + object.name = ""; + object.dataSourceId = ""; + object.displayName = ""; + object.description = ""; + object.clientId = ""; + object.transferType = options.enums === String ? "TRANSFER_TYPE_UNSPECIFIED" : 0; + object.supportsMultipleTransfers = false; + object.updateDeadlineSeconds = 0; + object.defaultSchedule = ""; + object.supportsCustomSchedule = false; + object.helpUrl = ""; + object.authorizationType = options.enums === String ? "AUTHORIZATION_TYPE_UNSPECIFIED" : 0; + object.dataRefreshType = options.enums === String ? "DATA_REFRESH_TYPE_UNSPECIFIED" : 0; + object.defaultDataRefreshWindowDays = 0; + object.manualRunsDisabled = false; + object.minimumScheduleInterval = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + object.dataSourceId = message.dataSourceId; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + if (message.transferType != null && message.hasOwnProperty("transferType")) + object.transferType = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferType[message.transferType] : message.transferType; + if (message.supportsMultipleTransfers != null && message.hasOwnProperty("supportsMultipleTransfers")) + object.supportsMultipleTransfers = message.supportsMultipleTransfers; + if (message.updateDeadlineSeconds != null && message.hasOwnProperty("updateDeadlineSeconds")) + object.updateDeadlineSeconds = message.updateDeadlineSeconds; + if (message.defaultSchedule != null && message.hasOwnProperty("defaultSchedule")) + object.defaultSchedule = message.defaultSchedule; + if (message.supportsCustomSchedule != null && message.hasOwnProperty("supportsCustomSchedule")) + object.supportsCustomSchedule = message.supportsCustomSchedule; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.toObject(message.parameters[j], options); + } + if (message.helpUrl != null && message.hasOwnProperty("helpUrl")) + object.helpUrl = message.helpUrl; + if (message.authorizationType != null && message.hasOwnProperty("authorizationType")) + object.authorizationType = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType[message.authorizationType] : message.authorizationType; + if (message.dataRefreshType != null && message.hasOwnProperty("dataRefreshType")) + object.dataRefreshType = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType[message.dataRefreshType] : message.dataRefreshType; + if (message.defaultDataRefreshWindowDays != null && message.hasOwnProperty("defaultDataRefreshWindowDays")) + object.defaultDataRefreshWindowDays = message.defaultDataRefreshWindowDays; + if (message.manualRunsDisabled != null && message.hasOwnProperty("manualRunsDisabled")) + object.manualRunsDisabled = message.manualRunsDisabled; + if (message.minimumScheduleInterval != null && message.hasOwnProperty("minimumScheduleInterval")) + object.minimumScheduleInterval = $root.google.protobuf.Duration.toObject(message.minimumScheduleInterval, options); + return object; + }; + + /** + * Converts this DataSource to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + * @returns {Object.} JSON object + */ + DataSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSource + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.DataSource"; + }; + + /** + * AuthorizationType enum. + * @name google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType + * @enum {number} + * @property {number} AUTHORIZATION_TYPE_UNSPECIFIED=0 AUTHORIZATION_TYPE_UNSPECIFIED value + * @property {number} AUTHORIZATION_CODE=1 AUTHORIZATION_CODE value + * @property {number} GOOGLE_PLUS_AUTHORIZATION_CODE=2 GOOGLE_PLUS_AUTHORIZATION_CODE value + * @property {number} FIRST_PARTY_OAUTH=3 FIRST_PARTY_OAUTH value + */ + DataSource.AuthorizationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTHORIZATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTHORIZATION_CODE"] = 1; + values[valuesById[2] = "GOOGLE_PLUS_AUTHORIZATION_CODE"] = 2; + values[valuesById[3] = "FIRST_PARTY_OAUTH"] = 3; + return values; + })(); + + /** + * DataRefreshType enum. + * @name google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType + * @enum {number} + * @property {number} DATA_REFRESH_TYPE_UNSPECIFIED=0 DATA_REFRESH_TYPE_UNSPECIFIED value + * @property {number} SLIDING_WINDOW=1 SLIDING_WINDOW value + * @property {number} CUSTOM_SLIDING_WINDOW=2 CUSTOM_SLIDING_WINDOW value + */ + DataSource.DataRefreshType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_REFRESH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SLIDING_WINDOW"] = 1; + values[valuesById[2] = "CUSTOM_SLIDING_WINDOW"] = 2; + return values; + })(); + + return DataSource; + })(); + + v1.GetDataSourceRequest = (function() { + + /** + * Properties of a GetDataSourceRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IGetDataSourceRequest + * @property {string|null} [name] GetDataSourceRequest name + */ + + /** + * Constructs a new GetDataSourceRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a GetDataSourceRequest. + * @implements IGetDataSourceRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest=} [properties] Properties to set + */ + function GetDataSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataSourceRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @instance + */ + GetDataSourceRequest.prototype.name = ""; + + /** + * Creates a new GetDataSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest} GetDataSourceRequest instance + */ + GetDataSourceRequest.create = function create(properties) { + return new GetDataSourceRequest(properties); + }; + + /** + * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceRequest.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 GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest} GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest(); + 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 GetDataSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest} GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataSourceRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataSourceRequest.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 GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest} GetDataSourceRequest + */ + GetDataSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest} message GetDataSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataSourceRequest.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 GetDataSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDataSourceRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDataSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest"; + }; + + return GetDataSourceRequest; + })(); + + v1.ListDataSourcesRequest = (function() { + + /** + * Properties of a ListDataSourcesRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListDataSourcesRequest + * @property {string|null} [parent] ListDataSourcesRequest parent + * @property {string|null} [pageToken] ListDataSourcesRequest pageToken + * @property {number|null} [pageSize] ListDataSourcesRequest pageSize + */ + + /** + * Constructs a new ListDataSourcesRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListDataSourcesRequest. + * @implements IListDataSourcesRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest=} [properties] Properties to set + */ + function ListDataSourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.parent = ""; + + /** + * ListDataSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.pageToken = ""; + + /** + * ListDataSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListDataSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest} ListDataSourcesRequest instance + */ + ListDataSourcesRequest.create = function create(properties) { + return new ListDataSourcesRequest(properties); + }; + + /** + * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest} ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest} ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourcesRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest} ListDataSourcesRequest + */ + ListDataSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListDataSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest} message ListDataSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListDataSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDataSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest"; + }; + + return ListDataSourcesRequest; + })(); + + v1.ListDataSourcesResponse = (function() { + + /** + * Properties of a ListDataSourcesResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListDataSourcesResponse + * @property {Array.|null} [dataSources] ListDataSourcesResponse dataSources + * @property {string|null} [nextPageToken] ListDataSourcesResponse nextPageToken + */ + + /** + * Constructs a new ListDataSourcesResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListDataSourcesResponse. + * @implements IListDataSourcesResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse=} [properties] Properties to set + */ + function ListDataSourcesResponse(properties) { + this.dataSources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataSourcesResponse dataSources. + * @member {Array.} dataSources + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.dataSources = $util.emptyArray; + + /** + * ListDataSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDataSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} ListDataSourcesResponse instance + */ + ListDataSourcesResponse.create = function create(properties) { + return new ListDataSourcesResponse(properties); + }; + + /** + * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSources != null && message.dataSources.length) + for (var i = 0; i < message.dataSources.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.DataSource.encode(message.dataSources[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 ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataSources && message.dataSources.length)) + message.dataSources = []; + message.dataSources.push($root.google.cloud.bigquery.datatransfer.v1.DataSource.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourcesResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataSources != null && message.hasOwnProperty("dataSources")) { + if (!Array.isArray(message.dataSources)) + return "dataSources: array expected"; + for (var i = 0; i < message.dataSources.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.DataSource.verify(message.dataSources[i]); + if (error) + return "dataSources." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} ListDataSourcesResponse + */ + ListDataSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse(); + if (object.dataSources) { + if (!Array.isArray(object.dataSources)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.dataSources: array expected"); + message.dataSources = []; + for (var i = 0; i < object.dataSources.length; ++i) { + if (typeof object.dataSources[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.dataSources: object expected"); + message.dataSources[i] = $root.google.cloud.bigquery.datatransfer.v1.DataSource.fromObject(object.dataSources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDataSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} message ListDataSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataSources = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dataSources && message.dataSources.length) { + object.dataSources = []; + for (var j = 0; j < message.dataSources.length; ++j) + object.dataSources[j] = $root.google.cloud.bigquery.datatransfer.v1.DataSource.toObject(message.dataSources[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDataSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDataSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse"; + }; + + return ListDataSourcesResponse; + })(); + + v1.CreateTransferConfigRequest = (function() { + + /** + * Properties of a CreateTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ICreateTransferConfigRequest + * @property {string|null} [parent] CreateTransferConfigRequest parent + * @property {google.cloud.bigquery.datatransfer.v1.ITransferConfig|null} [transferConfig] CreateTransferConfigRequest transferConfig + * @property {string|null} [authorizationCode] CreateTransferConfigRequest authorizationCode + * @property {string|null} [versionInfo] CreateTransferConfigRequest versionInfo + * @property {string|null} [serviceAccountName] CreateTransferConfigRequest serviceAccountName + */ + + /** + * Constructs a new CreateTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a CreateTransferConfigRequest. + * @implements ICreateTransferConfigRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest=} [properties] Properties to set + */ + function CreateTransferConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTransferConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + */ + CreateTransferConfigRequest.prototype.parent = ""; + + /** + * CreateTransferConfigRequest transferConfig. + * @member {google.cloud.bigquery.datatransfer.v1.ITransferConfig|null|undefined} transferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + */ + CreateTransferConfigRequest.prototype.transferConfig = null; + + /** + * CreateTransferConfigRequest authorizationCode. + * @member {string} authorizationCode + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + */ + CreateTransferConfigRequest.prototype.authorizationCode = ""; + + /** + * CreateTransferConfigRequest versionInfo. + * @member {string} versionInfo + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + */ + CreateTransferConfigRequest.prototype.versionInfo = ""; + + /** + * CreateTransferConfigRequest serviceAccountName. + * @member {string} serviceAccountName + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + */ + CreateTransferConfigRequest.prototype.serviceAccountName = ""; + + /** + * Creates a new CreateTransferConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest} CreateTransferConfigRequest instance + */ + CreateTransferConfigRequest.create = function create(properties) { + return new CreateTransferConfigRequest(properties); + }; + + /** + * Encodes the specified CreateTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest} message CreateTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransferConfigRequest.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.transferConfig != null && Object.hasOwnProperty.call(message, "transferConfig")) + $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.encode(message.transferConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.authorizationCode != null && Object.hasOwnProperty.call(message, "authorizationCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.authorizationCode); + if (message.versionInfo != null && Object.hasOwnProperty.call(message, "versionInfo")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.versionInfo); + if (message.serviceAccountName != null && Object.hasOwnProperty.call(message, "serviceAccountName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceAccountName); + return writer; + }; + + /** + * Encodes the specified CreateTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest} message CreateTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransferConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTransferConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest} CreateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransferConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.authorizationCode = reader.string(); + break; + } + case 5: { + message.versionInfo = reader.string(); + break; + } + case 6: { + message.serviceAccountName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTransferConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest} CreateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransferConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTransferConfigRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTransferConfigRequest.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.transferConfig != null && message.hasOwnProperty("transferConfig")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.verify(message.transferConfig); + if (error) + return "transferConfig." + error; + } + if (message.authorizationCode != null && message.hasOwnProperty("authorizationCode")) + if (!$util.isString(message.authorizationCode)) + return "authorizationCode: string expected"; + if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) + if (!$util.isString(message.versionInfo)) + return "versionInfo: string expected"; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + if (!$util.isString(message.serviceAccountName)) + return "serviceAccountName: string expected"; + return null; + }; + + /** + * Creates a CreateTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest} CreateTransferConfigRequest + */ + CreateTransferConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.transferConfig != null) { + if (typeof object.transferConfig !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest.transferConfig: object expected"); + message.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.fromObject(object.transferConfig); + } + if (object.authorizationCode != null) + message.authorizationCode = String(object.authorizationCode); + if (object.versionInfo != null) + message.versionInfo = String(object.versionInfo); + if (object.serviceAccountName != null) + message.serviceAccountName = String(object.serviceAccountName); + return message; + }; + + /** + * Creates a plain object from a CreateTransferConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest} message CreateTransferConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTransferConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.transferConfig = null; + object.authorizationCode = ""; + object.versionInfo = ""; + object.serviceAccountName = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.transferConfig != null && message.hasOwnProperty("transferConfig")) + object.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.toObject(message.transferConfig, options); + if (message.authorizationCode != null && message.hasOwnProperty("authorizationCode")) + object.authorizationCode = message.authorizationCode; + if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) + object.versionInfo = message.versionInfo; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + object.serviceAccountName = message.serviceAccountName; + return object; + }; + + /** + * Converts this CreateTransferConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTransferConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTransferConfigRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTransferConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest"; + }; + + return CreateTransferConfigRequest; + })(); + + v1.UpdateTransferConfigRequest = (function() { + + /** + * Properties of an UpdateTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IUpdateTransferConfigRequest + * @property {google.cloud.bigquery.datatransfer.v1.ITransferConfig|null} [transferConfig] UpdateTransferConfigRequest transferConfig + * @property {string|null} [authorizationCode] UpdateTransferConfigRequest authorizationCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTransferConfigRequest updateMask + * @property {string|null} [versionInfo] UpdateTransferConfigRequest versionInfo + * @property {string|null} [serviceAccountName] UpdateTransferConfigRequest serviceAccountName + */ + + /** + * Constructs a new UpdateTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents an UpdateTransferConfigRequest. + * @implements IUpdateTransferConfigRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest=} [properties] Properties to set + */ + function UpdateTransferConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTransferConfigRequest transferConfig. + * @member {google.cloud.bigquery.datatransfer.v1.ITransferConfig|null|undefined} transferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + */ + UpdateTransferConfigRequest.prototype.transferConfig = null; + + /** + * UpdateTransferConfigRequest authorizationCode. + * @member {string} authorizationCode + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + */ + UpdateTransferConfigRequest.prototype.authorizationCode = ""; + + /** + * UpdateTransferConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + */ + UpdateTransferConfigRequest.prototype.updateMask = null; + + /** + * UpdateTransferConfigRequest versionInfo. + * @member {string} versionInfo + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + */ + UpdateTransferConfigRequest.prototype.versionInfo = ""; + + /** + * UpdateTransferConfigRequest serviceAccountName. + * @member {string} serviceAccountName + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + */ + UpdateTransferConfigRequest.prototype.serviceAccountName = ""; + + /** + * Creates a new UpdateTransferConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest} UpdateTransferConfigRequest instance + */ + UpdateTransferConfigRequest.create = function create(properties) { + return new UpdateTransferConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest} message UpdateTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTransferConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferConfig != null && Object.hasOwnProperty.call(message, "transferConfig")) + $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.encode(message.transferConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.authorizationCode != null && Object.hasOwnProperty.call(message, "authorizationCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.authorizationCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.versionInfo != null && Object.hasOwnProperty.call(message, "versionInfo")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.versionInfo); + if (message.serviceAccountName != null && Object.hasOwnProperty.call(message, "serviceAccountName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceAccountName); + return writer; + }; + + /** + * Encodes the specified UpdateTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest} message UpdateTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTransferConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTransferConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest} UpdateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTransferConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.authorizationCode = reader.string(); + break; + } + case 4: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 5: { + message.versionInfo = reader.string(); + break; + } + case 6: { + message.serviceAccountName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTransferConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest} UpdateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTransferConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTransferConfigRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTransferConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferConfig != null && message.hasOwnProperty("transferConfig")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.verify(message.transferConfig); + if (error) + return "transferConfig." + error; + } + if (message.authorizationCode != null && message.hasOwnProperty("authorizationCode")) + if (!$util.isString(message.authorizationCode)) + return "authorizationCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) + if (!$util.isString(message.versionInfo)) + return "versionInfo: string expected"; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + if (!$util.isString(message.serviceAccountName)) + return "serviceAccountName: string expected"; + return null; + }; + + /** + * Creates an UpdateTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest} UpdateTransferConfigRequest + */ + UpdateTransferConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest(); + if (object.transferConfig != null) { + if (typeof object.transferConfig !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.transferConfig: object expected"); + message.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.fromObject(object.transferConfig); + } + if (object.authorizationCode != null) + message.authorizationCode = String(object.authorizationCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.versionInfo != null) + message.versionInfo = String(object.versionInfo); + if (object.serviceAccountName != null) + message.serviceAccountName = String(object.serviceAccountName); + return message; + }; + + /** + * Creates a plain object from an UpdateTransferConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest} message UpdateTransferConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTransferConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.transferConfig = null; + object.authorizationCode = ""; + object.updateMask = null; + object.versionInfo = ""; + object.serviceAccountName = ""; + } + if (message.transferConfig != null && message.hasOwnProperty("transferConfig")) + object.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.toObject(message.transferConfig, options); + if (message.authorizationCode != null && message.hasOwnProperty("authorizationCode")) + object.authorizationCode = message.authorizationCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) + object.versionInfo = message.versionInfo; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + object.serviceAccountName = message.serviceAccountName; + return object; + }; + + /** + * Converts this UpdateTransferConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTransferConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTransferConfigRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTransferConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest"; + }; + + return UpdateTransferConfigRequest; + })(); + + v1.GetTransferConfigRequest = (function() { + + /** + * Properties of a GetTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IGetTransferConfigRequest + * @property {string|null} [name] GetTransferConfigRequest name + */ + + /** + * Constructs a new GetTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a GetTransferConfigRequest. + * @implements IGetTransferConfigRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest=} [properties] Properties to set + */ + function GetTransferConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTransferConfigRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @instance + */ + GetTransferConfigRequest.prototype.name = ""; + + /** + * Creates a new GetTransferConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest} GetTransferConfigRequest instance + */ + GetTransferConfigRequest.create = function create(properties) { + return new GetTransferConfigRequest(properties); + }; + + /** + * Encodes the specified GetTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest} message GetTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransferConfigRequest.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 GetTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest} message GetTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransferConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTransferConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest} GetTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransferConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest(); + 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 GetTransferConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest} GetTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransferConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTransferConfigRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTransferConfigRequest.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 GetTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest} GetTransferConfigRequest + */ + GetTransferConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTransferConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest} message GetTransferConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTransferConfigRequest.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 GetTransferConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetTransferConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTransferConfigRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTransferConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest"; + }; + + return GetTransferConfigRequest; + })(); + + v1.DeleteTransferConfigRequest = (function() { + + /** + * Properties of a DeleteTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IDeleteTransferConfigRequest + * @property {string|null} [name] DeleteTransferConfigRequest name + */ + + /** + * Constructs a new DeleteTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a DeleteTransferConfigRequest. + * @implements IDeleteTransferConfigRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest=} [properties] Properties to set + */ + function DeleteTransferConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTransferConfigRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @instance + */ + DeleteTransferConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteTransferConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest} DeleteTransferConfigRequest instance + */ + DeleteTransferConfigRequest.create = function create(properties) { + return new DeleteTransferConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest} message DeleteTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransferConfigRequest.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 DeleteTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest} message DeleteTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransferConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTransferConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest} DeleteTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransferConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest(); + 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 DeleteTransferConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest} DeleteTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransferConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTransferConfigRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTransferConfigRequest.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 DeleteTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest} DeleteTransferConfigRequest + */ + DeleteTransferConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTransferConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest} message DeleteTransferConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTransferConfigRequest.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 DeleteTransferConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTransferConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTransferConfigRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTransferConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest"; + }; + + return DeleteTransferConfigRequest; + })(); + + v1.GetTransferRunRequest = (function() { + + /** + * Properties of a GetTransferRunRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IGetTransferRunRequest + * @property {string|null} [name] GetTransferRunRequest name + */ + + /** + * Constructs a new GetTransferRunRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a GetTransferRunRequest. + * @implements IGetTransferRunRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest=} [properties] Properties to set + */ + function GetTransferRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTransferRunRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @instance + */ + GetTransferRunRequest.prototype.name = ""; + + /** + * Creates a new GetTransferRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest} GetTransferRunRequest instance + */ + GetTransferRunRequest.create = function create(properties) { + return new GetTransferRunRequest(properties); + }; + + /** + * Encodes the specified GetTransferRunRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest} message GetTransferRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransferRunRequest.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 GetTransferRunRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest} message GetTransferRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransferRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTransferRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest} GetTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransferRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest(); + 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 GetTransferRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest} GetTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransferRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTransferRunRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTransferRunRequest.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 GetTransferRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest} GetTransferRunRequest + */ + GetTransferRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTransferRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest} message GetTransferRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTransferRunRequest.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 GetTransferRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @instance + * @returns {Object.} JSON object + */ + GetTransferRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTransferRunRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTransferRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest"; + }; + + return GetTransferRunRequest; + })(); + + v1.DeleteTransferRunRequest = (function() { + + /** + * Properties of a DeleteTransferRunRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IDeleteTransferRunRequest + * @property {string|null} [name] DeleteTransferRunRequest name + */ + + /** + * Constructs a new DeleteTransferRunRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a DeleteTransferRunRequest. + * @implements IDeleteTransferRunRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest=} [properties] Properties to set + */ + function DeleteTransferRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTransferRunRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @instance + */ + DeleteTransferRunRequest.prototype.name = ""; + + /** + * Creates a new DeleteTransferRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest} DeleteTransferRunRequest instance + */ + DeleteTransferRunRequest.create = function create(properties) { + return new DeleteTransferRunRequest(properties); + }; + + /** + * Encodes the specified DeleteTransferRunRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest} message DeleteTransferRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransferRunRequest.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 DeleteTransferRunRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest} message DeleteTransferRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransferRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTransferRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest} DeleteTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransferRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest(); + 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 DeleteTransferRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest} DeleteTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransferRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTransferRunRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTransferRunRequest.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 DeleteTransferRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest} DeleteTransferRunRequest + */ + DeleteTransferRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTransferRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest} message DeleteTransferRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTransferRunRequest.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 DeleteTransferRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTransferRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTransferRunRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTransferRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest"; + }; + + return DeleteTransferRunRequest; + })(); + + v1.ListTransferConfigsRequest = (function() { + + /** + * Properties of a ListTransferConfigsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferConfigsRequest + * @property {string|null} [parent] ListTransferConfigsRequest parent + * @property {Array.|null} [dataSourceIds] ListTransferConfigsRequest dataSourceIds + * @property {string|null} [pageToken] ListTransferConfigsRequest pageToken + * @property {number|null} [pageSize] ListTransferConfigsRequest pageSize + */ + + /** + * Constructs a new ListTransferConfigsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferConfigsRequest. + * @implements IListTransferConfigsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest=} [properties] Properties to set + */ + function ListTransferConfigsRequest(properties) { + this.dataSourceIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @instance + */ + ListTransferConfigsRequest.prototype.parent = ""; + + /** + * ListTransferConfigsRequest dataSourceIds. + * @member {Array.} dataSourceIds + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @instance + */ + ListTransferConfigsRequest.prototype.dataSourceIds = $util.emptyArray; + + /** + * ListTransferConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @instance + */ + ListTransferConfigsRequest.prototype.pageToken = ""; + + /** + * ListTransferConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @instance + */ + ListTransferConfigsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListTransferConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest} ListTransferConfigsRequest instance + */ + ListTransferConfigsRequest.create = function create(properties) { + return new ListTransferConfigsRequest(properties); + }; + + /** + * Encodes the specified ListTransferConfigsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest} message ListTransferConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferConfigsRequest.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.dataSourceIds != null && message.dataSourceIds.length) + for (var i = 0; i < message.dataSourceIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSourceIds[i]); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListTransferConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest} message ListTransferConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest} ListTransferConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.dataSourceIds && message.dataSourceIds.length)) + message.dataSourceIds = []; + message.dataSourceIds.push(reader.string()); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest} ListTransferConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferConfigsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferConfigsRequest.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.dataSourceIds != null && message.hasOwnProperty("dataSourceIds")) { + if (!Array.isArray(message.dataSourceIds)) + return "dataSourceIds: array expected"; + for (var i = 0; i < message.dataSourceIds.length; ++i) + if (!$util.isString(message.dataSourceIds[i])) + return "dataSourceIds: string[] expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListTransferConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest} ListTransferConfigsRequest + */ + ListTransferConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataSourceIds) { + if (!Array.isArray(object.dataSourceIds)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest.dataSourceIds: array expected"); + message.dataSourceIds = []; + for (var i = 0; i < object.dataSourceIds.length; ++i) + message.dataSourceIds[i] = String(object.dataSourceIds[i]); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListTransferConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest} message ListTransferConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataSourceIds = []; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dataSourceIds && message.dataSourceIds.length) { + object.dataSourceIds = []; + for (var j = 0; j < message.dataSourceIds.length; ++j) + object.dataSourceIds[j] = message.dataSourceIds[j]; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListTransferConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTransferConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest"; + }; + + return ListTransferConfigsRequest; + })(); + + v1.ListTransferConfigsResponse = (function() { + + /** + * Properties of a ListTransferConfigsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferConfigsResponse + * @property {Array.|null} [transferConfigs] ListTransferConfigsResponse transferConfigs + * @property {string|null} [nextPageToken] ListTransferConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListTransferConfigsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferConfigsResponse. + * @implements IListTransferConfigsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse=} [properties] Properties to set + */ + function ListTransferConfigsResponse(properties) { + this.transferConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferConfigsResponse transferConfigs. + * @member {Array.} transferConfigs + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @instance + */ + ListTransferConfigsResponse.prototype.transferConfigs = $util.emptyArray; + + /** + * ListTransferConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @instance + */ + ListTransferConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTransferConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} ListTransferConfigsResponse instance + */ + ListTransferConfigsResponse.create = function create(properties) { + return new ListTransferConfigsResponse(properties); + }; + + /** + * Encodes the specified ListTransferConfigsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse} message ListTransferConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferConfigs != null && message.transferConfigs.length) + for (var i = 0; i < message.transferConfigs.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.encode(message.transferConfigs[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 ListTransferConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse} message ListTransferConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} ListTransferConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.transferConfigs && message.transferConfigs.length)) + message.transferConfigs = []; + message.transferConfigs.push($root.google.cloud.bigquery.datatransfer.v1.TransferConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} ListTransferConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferConfigsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferConfigs != null && message.hasOwnProperty("transferConfigs")) { + if (!Array.isArray(message.transferConfigs)) + return "transferConfigs: array expected"; + for (var i = 0; i < message.transferConfigs.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.verify(message.transferConfigs[i]); + if (error) + return "transferConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransferConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} ListTransferConfigsResponse + */ + ListTransferConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse(); + if (object.transferConfigs) { + if (!Array.isArray(object.transferConfigs)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.transferConfigs: array expected"); + message.transferConfigs = []; + for (var i = 0; i < object.transferConfigs.length; ++i) { + if (typeof object.transferConfigs[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.transferConfigs: object expected"); + message.transferConfigs[i] = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.fromObject(object.transferConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransferConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} message ListTransferConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transferConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.transferConfigs && message.transferConfigs.length) { + object.transferConfigs = []; + for (var j = 0; j < message.transferConfigs.length; ++j) + object.transferConfigs[j] = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.toObject(message.transferConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTransferConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTransferConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse"; + }; + + return ListTransferConfigsResponse; + })(); + + v1.ListTransferRunsRequest = (function() { + + /** + * Properties of a ListTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferRunsRequest + * @property {string|null} [parent] ListTransferRunsRequest parent + * @property {Array.|null} [states] ListTransferRunsRequest states + * @property {string|null} [pageToken] ListTransferRunsRequest pageToken + * @property {number|null} [pageSize] ListTransferRunsRequest pageSize + * @property {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt|null} [runAttempt] ListTransferRunsRequest runAttempt + */ + + /** + * Constructs a new ListTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferRunsRequest. + * @implements IListTransferRunsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest=} [properties] Properties to set + */ + function ListTransferRunsRequest(properties) { + this.states = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + */ + ListTransferRunsRequest.prototype.parent = ""; + + /** + * ListTransferRunsRequest states. + * @member {Array.} states + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + */ + ListTransferRunsRequest.prototype.states = $util.emptyArray; + + /** + * ListTransferRunsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + */ + ListTransferRunsRequest.prototype.pageToken = ""; + + /** + * ListTransferRunsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + */ + ListTransferRunsRequest.prototype.pageSize = 0; + + /** + * ListTransferRunsRequest runAttempt. + * @member {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt} runAttempt + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + */ + ListTransferRunsRequest.prototype.runAttempt = 0; + + /** + * Creates a new ListTransferRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest} ListTransferRunsRequest instance + */ + ListTransferRunsRequest.create = function create(properties) { + return new ListTransferRunsRequest(properties); + }; + + /** + * Encodes the specified ListTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest} message ListTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferRunsRequest.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.states != null && message.states.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.states.length; ++i) + writer.int32(message.states[i]); + writer.ldelim(); + } + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.runAttempt != null && Object.hasOwnProperty.call(message, "runAttempt")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.runAttempt); + return writer; + }; + + /** + * Encodes the specified ListTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest} message ListTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest} ListTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.states && message.states.length)) + message.states = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.states.push(reader.int32()); + } else + message.states.push(reader.int32()); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.runAttempt = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest} ListTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferRunsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferRunsRequest.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.states != null && message.hasOwnProperty("states")) { + if (!Array.isArray(message.states)) + return "states: array expected"; + for (var i = 0; i < message.states.length; ++i) + switch (message.states[i]) { + default: + return "states: enum value[] expected"; + case 0: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.runAttempt != null && message.hasOwnProperty("runAttempt")) + switch (message.runAttempt) { + default: + return "runAttempt: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a ListTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest} ListTransferRunsRequest + */ + ListTransferRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.states) { + if (!Array.isArray(object.states)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.states: array expected"); + message.states = []; + for (var i = 0; i < object.states.length; ++i) + switch (object.states[i]) { + default: + case "TRANSFER_STATE_UNSPECIFIED": + case 0: + message.states[i] = 0; + break; + case "PENDING": + case 2: + message.states[i] = 2; + break; + case "RUNNING": + case 3: + message.states[i] = 3; + break; + case "SUCCEEDED": + case 4: + message.states[i] = 4; + break; + case "FAILED": + case 5: + message.states[i] = 5; + break; + case "CANCELLED": + case 6: + message.states[i] = 6; + break; + } + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + switch (object.runAttempt) { + case "RUN_ATTEMPT_UNSPECIFIED": + case 0: + message.runAttempt = 0; + break; + case "LATEST": + case 1: + message.runAttempt = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListTransferRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest} message ListTransferRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferRunsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.states = []; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + object.runAttempt = options.enums === String ? "RUN_ATTEMPT_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.states && message.states.length) { + object.states = []; + for (var j = 0; j < message.states.length; ++j) + object.states[j] = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferState[message.states[j]] : message.states[j]; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.runAttempt != null && message.hasOwnProperty("runAttempt")) + object.runAttempt = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt[message.runAttempt] : message.runAttempt; + return object; + }; + + /** + * Converts this ListTransferRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTransferRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferRunsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest"; + }; + + /** + * RunAttempt enum. + * @name google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt + * @enum {number} + * @property {number} RUN_ATTEMPT_UNSPECIFIED=0 RUN_ATTEMPT_UNSPECIFIED value + * @property {number} LATEST=1 LATEST value + */ + ListTransferRunsRequest.RunAttempt = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RUN_ATTEMPT_UNSPECIFIED"] = 0; + values[valuesById[1] = "LATEST"] = 1; + return values; + })(); + + return ListTransferRunsRequest; + })(); + + v1.ListTransferRunsResponse = (function() { + + /** + * Properties of a ListTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferRunsResponse + * @property {Array.|null} [transferRuns] ListTransferRunsResponse transferRuns + * @property {string|null} [nextPageToken] ListTransferRunsResponse nextPageToken + */ + + /** + * Constructs a new ListTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferRunsResponse. + * @implements IListTransferRunsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse=} [properties] Properties to set + */ + function ListTransferRunsResponse(properties) { + this.transferRuns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferRunsResponse transferRuns. + * @member {Array.} transferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @instance + */ + ListTransferRunsResponse.prototype.transferRuns = $util.emptyArray; + + /** + * ListTransferRunsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @instance + */ + ListTransferRunsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTransferRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} ListTransferRunsResponse instance + */ + ListTransferRunsResponse.create = function create(properties) { + return new ListTransferRunsResponse(properties); + }; + + /** + * Encodes the specified ListTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse} message ListTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferRuns != null && message.transferRuns.length) + for (var i = 0; i < message.transferRuns.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.TransferRun.encode(message.transferRuns[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 ListTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse} message ListTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} ListTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.transferRuns && message.transferRuns.length)) + message.transferRuns = []; + message.transferRuns.push($root.google.cloud.bigquery.datatransfer.v1.TransferRun.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} ListTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferRunsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferRuns != null && message.hasOwnProperty("transferRuns")) { + if (!Array.isArray(message.transferRuns)) + return "transferRuns: array expected"; + for (var i = 0; i < message.transferRuns.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.verify(message.transferRuns[i]); + if (error) + return "transferRuns." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} ListTransferRunsResponse + */ + ListTransferRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse(); + if (object.transferRuns) { + if (!Array.isArray(object.transferRuns)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.transferRuns: array expected"); + message.transferRuns = []; + for (var i = 0; i < object.transferRuns.length; ++i) { + if (typeof object.transferRuns[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.transferRuns: object expected"); + message.transferRuns[i] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.fromObject(object.transferRuns[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransferRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} message ListTransferRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transferRuns = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.transferRuns && message.transferRuns.length) { + object.transferRuns = []; + for (var j = 0; j < message.transferRuns.length; ++j) + object.transferRuns[j] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.toObject(message.transferRuns[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTransferRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTransferRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferRunsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse"; + }; + + return ListTransferRunsResponse; + })(); + + v1.ListTransferLogsRequest = (function() { + + /** + * Properties of a ListTransferLogsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferLogsRequest + * @property {string|null} [parent] ListTransferLogsRequest parent + * @property {string|null} [pageToken] ListTransferLogsRequest pageToken + * @property {number|null} [pageSize] ListTransferLogsRequest pageSize + * @property {Array.|null} [messageTypes] ListTransferLogsRequest messageTypes + */ + + /** + * Constructs a new ListTransferLogsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferLogsRequest. + * @implements IListTransferLogsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest=} [properties] Properties to set + */ + function ListTransferLogsRequest(properties) { + this.messageTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferLogsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @instance + */ + ListTransferLogsRequest.prototype.parent = ""; + + /** + * ListTransferLogsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @instance + */ + ListTransferLogsRequest.prototype.pageToken = ""; + + /** + * ListTransferLogsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @instance + */ + ListTransferLogsRequest.prototype.pageSize = 0; + + /** + * ListTransferLogsRequest messageTypes. + * @member {Array.} messageTypes + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @instance + */ + ListTransferLogsRequest.prototype.messageTypes = $util.emptyArray; + + /** + * Creates a new ListTransferLogsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest} ListTransferLogsRequest instance + */ + ListTransferLogsRequest.create = function create(properties) { + return new ListTransferLogsRequest(properties); + }; + + /** + * Encodes the specified ListTransferLogsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest} message ListTransferLogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferLogsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); + if (message.messageTypes != null && message.messageTypes.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.messageTypes.length; ++i) + writer.int32(message.messageTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ListTransferLogsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest} message ListTransferLogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferLogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferLogsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest} ListTransferLogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferLogsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + case 6: { + if (!(message.messageTypes && message.messageTypes.length)) + message.messageTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.messageTypes.push(reader.int32()); + } else + message.messageTypes.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferLogsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest} ListTransferLogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferLogsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferLogsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferLogsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.messageTypes != null && message.hasOwnProperty("messageTypes")) { + if (!Array.isArray(message.messageTypes)) + return "messageTypes: array expected"; + for (var i = 0; i < message.messageTypes.length; ++i) + switch (message.messageTypes[i]) { + default: + return "messageTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a ListTransferLogsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest} ListTransferLogsRequest + */ + ListTransferLogsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.messageTypes) { + if (!Array.isArray(object.messageTypes)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest.messageTypes: array expected"); + message.messageTypes = []; + for (var i = 0; i < object.messageTypes.length; ++i) + switch (object.messageTypes[i]) { + default: + case "MESSAGE_SEVERITY_UNSPECIFIED": + case 0: + message.messageTypes[i] = 0; + break; + case "INFO": + case 1: + message.messageTypes[i] = 1; + break; + case "WARNING": + case 2: + message.messageTypes[i] = 2; + break; + case "ERROR": + case 3: + message.messageTypes[i] = 3; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ListTransferLogsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest} message ListTransferLogsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferLogsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messageTypes = []; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.messageTypes && message.messageTypes.length) { + object.messageTypes = []; + for (var j = 0; j < message.messageTypes.length; ++j) + object.messageTypes[j] = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity[message.messageTypes[j]] : message.messageTypes[j]; + } + return object; + }; + + /** + * Converts this ListTransferLogsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTransferLogsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferLogsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferLogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest"; + }; + + return ListTransferLogsRequest; + })(); + + v1.ListTransferLogsResponse = (function() { + + /** + * Properties of a ListTransferLogsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferLogsResponse + * @property {Array.|null} [transferMessages] ListTransferLogsResponse transferMessages + * @property {string|null} [nextPageToken] ListTransferLogsResponse nextPageToken + */ + + /** + * Constructs a new ListTransferLogsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferLogsResponse. + * @implements IListTransferLogsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse=} [properties] Properties to set + */ + function ListTransferLogsResponse(properties) { + this.transferMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferLogsResponse transferMessages. + * @member {Array.} transferMessages + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @instance + */ + ListTransferLogsResponse.prototype.transferMessages = $util.emptyArray; + + /** + * ListTransferLogsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @instance + */ + ListTransferLogsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTransferLogsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} ListTransferLogsResponse instance + */ + ListTransferLogsResponse.create = function create(properties) { + return new ListTransferLogsResponse(properties); + }; + + /** + * Encodes the specified ListTransferLogsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse} message ListTransferLogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferLogsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferMessages != null && message.transferMessages.length) + for (var i = 0; i < message.transferMessages.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.encode(message.transferMessages[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 ListTransferLogsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse} message ListTransferLogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferLogsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferLogsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} ListTransferLogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferLogsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.transferMessages && message.transferMessages.length)) + message.transferMessages = []; + message.transferMessages.push($root.google.cloud.bigquery.datatransfer.v1.TransferMessage.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferLogsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} ListTransferLogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferLogsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferLogsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferLogsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferMessages != null && message.hasOwnProperty("transferMessages")) { + if (!Array.isArray(message.transferMessages)) + return "transferMessages: array expected"; + for (var i = 0; i < message.transferMessages.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.verify(message.transferMessages[i]); + if (error) + return "transferMessages." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransferLogsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} ListTransferLogsResponse + */ + ListTransferLogsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse(); + if (object.transferMessages) { + if (!Array.isArray(object.transferMessages)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.transferMessages: array expected"); + message.transferMessages = []; + for (var i = 0; i < object.transferMessages.length; ++i) { + if (typeof object.transferMessages[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.transferMessages: object expected"); + message.transferMessages[i] = $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.fromObject(object.transferMessages[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransferLogsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} message ListTransferLogsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferLogsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transferMessages = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.transferMessages && message.transferMessages.length) { + object.transferMessages = []; + for (var j = 0; j < message.transferMessages.length; ++j) + object.transferMessages[j] = $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.toObject(message.transferMessages[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTransferLogsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTransferLogsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferLogsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferLogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse"; + }; + + return ListTransferLogsResponse; + })(); + + v1.CheckValidCredsRequest = (function() { + + /** + * Properties of a CheckValidCredsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ICheckValidCredsRequest + * @property {string|null} [name] CheckValidCredsRequest name + */ + + /** + * Constructs a new CheckValidCredsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a CheckValidCredsRequest. + * @implements ICheckValidCredsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest=} [properties] Properties to set + */ + function CheckValidCredsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckValidCredsRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @instance + */ + CheckValidCredsRequest.prototype.name = ""; + + /** + * Creates a new CheckValidCredsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest} CheckValidCredsRequest instance + */ + CheckValidCredsRequest.create = function create(properties) { + return new CheckValidCredsRequest(properties); + }; + + /** + * Encodes the specified CheckValidCredsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest} message CheckValidCredsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckValidCredsRequest.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 CheckValidCredsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest} message CheckValidCredsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckValidCredsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckValidCredsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest} CheckValidCredsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckValidCredsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest(); + 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 CheckValidCredsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest} CheckValidCredsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckValidCredsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckValidCredsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckValidCredsRequest.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 CheckValidCredsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest} CheckValidCredsRequest + */ + CheckValidCredsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CheckValidCredsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest} message CheckValidCredsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckValidCredsRequest.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 CheckValidCredsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @instance + * @returns {Object.} JSON object + */ + CheckValidCredsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckValidCredsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckValidCredsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest"; + }; + + return CheckValidCredsRequest; + })(); + + v1.CheckValidCredsResponse = (function() { + + /** + * Properties of a CheckValidCredsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ICheckValidCredsResponse + * @property {boolean|null} [hasValidCreds] CheckValidCredsResponse hasValidCreds + */ + + /** + * Constructs a new CheckValidCredsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a CheckValidCredsResponse. + * @implements ICheckValidCredsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse=} [properties] Properties to set + */ + function CheckValidCredsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckValidCredsResponse hasValidCreds. + * @member {boolean} hasValidCreds + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @instance + */ + CheckValidCredsResponse.prototype.hasValidCreds = false; + + /** + * Creates a new CheckValidCredsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} CheckValidCredsResponse instance + */ + CheckValidCredsResponse.create = function create(properties) { + return new CheckValidCredsResponse(properties); + }; + + /** + * Encodes the specified CheckValidCredsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse} message CheckValidCredsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckValidCredsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hasValidCreds != null && Object.hasOwnProperty.call(message, "hasValidCreds")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.hasValidCreds); + return writer; + }; + + /** + * Encodes the specified CheckValidCredsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse} message CheckValidCredsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckValidCredsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckValidCredsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} CheckValidCredsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckValidCredsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hasValidCreds = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckValidCredsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} CheckValidCredsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckValidCredsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckValidCredsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckValidCredsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hasValidCreds != null && message.hasOwnProperty("hasValidCreds")) + if (typeof message.hasValidCreds !== "boolean") + return "hasValidCreds: boolean expected"; + return null; + }; + + /** + * Creates a CheckValidCredsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} CheckValidCredsResponse + */ + CheckValidCredsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse(); + if (object.hasValidCreds != null) + message.hasValidCreds = Boolean(object.hasValidCreds); + return message; + }; + + /** + * Creates a plain object from a CheckValidCredsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} message CheckValidCredsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckValidCredsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.hasValidCreds = false; + if (message.hasValidCreds != null && message.hasOwnProperty("hasValidCreds")) + object.hasValidCreds = message.hasValidCreds; + return object; + }; + + /** + * Converts this CheckValidCredsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @instance + * @returns {Object.} JSON object + */ + CheckValidCredsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckValidCredsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckValidCredsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse"; + }; + + return CheckValidCredsResponse; + })(); + + v1.ScheduleTransferRunsRequest = (function() { + + /** + * Properties of a ScheduleTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IScheduleTransferRunsRequest + * @property {string|null} [parent] ScheduleTransferRunsRequest parent + * @property {google.protobuf.ITimestamp|null} [startTime] ScheduleTransferRunsRequest startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ScheduleTransferRunsRequest endTime + */ + + /** + * Constructs a new ScheduleTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ScheduleTransferRunsRequest. + * @implements IScheduleTransferRunsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest=} [properties] Properties to set + */ + function ScheduleTransferRunsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScheduleTransferRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @instance + */ + ScheduleTransferRunsRequest.prototype.parent = ""; + + /** + * ScheduleTransferRunsRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @instance + */ + ScheduleTransferRunsRequest.prototype.startTime = null; + + /** + * ScheduleTransferRunsRequest endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @instance + */ + ScheduleTransferRunsRequest.prototype.endTime = null; + + /** + * Creates a new ScheduleTransferRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest} ScheduleTransferRunsRequest instance + */ + ScheduleTransferRunsRequest.create = function create(properties) { + return new ScheduleTransferRunsRequest(properties); + }; + + /** + * Encodes the specified ScheduleTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest} message ScheduleTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleTransferRunsRequest.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.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScheduleTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest} message ScheduleTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleTransferRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduleTransferRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest} ScheduleTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleTransferRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduleTransferRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest} ScheduleTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleTransferRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduleTransferRunsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduleTransferRunsRequest.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.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 ScheduleTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest} ScheduleTransferRunsRequest + */ + ScheduleTransferRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a ScheduleTransferRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest} message ScheduleTransferRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduleTransferRunsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.startTime = null; + object.endTime = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ScheduleTransferRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ScheduleTransferRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScheduleTransferRunsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleTransferRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest"; + }; + + return ScheduleTransferRunsRequest; + })(); + + v1.ScheduleTransferRunsResponse = (function() { + + /** + * Properties of a ScheduleTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IScheduleTransferRunsResponse + * @property {Array.|null} [runs] ScheduleTransferRunsResponse runs + */ + + /** + * Constructs a new ScheduleTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ScheduleTransferRunsResponse. + * @implements IScheduleTransferRunsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse=} [properties] Properties to set + */ + function ScheduleTransferRunsResponse(properties) { + this.runs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScheduleTransferRunsResponse runs. + * @member {Array.} runs + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @instance + */ + ScheduleTransferRunsResponse.prototype.runs = $util.emptyArray; + + /** + * Creates a new ScheduleTransferRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} ScheduleTransferRunsResponse instance + */ + ScheduleTransferRunsResponse.create = function create(properties) { + return new ScheduleTransferRunsResponse(properties); + }; + + /** + * Encodes the specified ScheduleTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse} message ScheduleTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleTransferRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runs != null && message.runs.length) + for (var i = 0; i < message.runs.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.TransferRun.encode(message.runs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScheduleTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse} message ScheduleTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleTransferRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduleTransferRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} ScheduleTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleTransferRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.runs && message.runs.length)) + message.runs = []; + message.runs.push($root.google.cloud.bigquery.datatransfer.v1.TransferRun.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduleTransferRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} ScheduleTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleTransferRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduleTransferRunsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduleTransferRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runs != null && message.hasOwnProperty("runs")) { + if (!Array.isArray(message.runs)) + return "runs: array expected"; + for (var i = 0; i < message.runs.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.verify(message.runs[i]); + if (error) + return "runs." + error; + } + } + return null; + }; + + /** + * Creates a ScheduleTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} ScheduleTransferRunsResponse + */ + ScheduleTransferRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse(); + if (object.runs) { + if (!Array.isArray(object.runs)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.runs: array expected"); + message.runs = []; + for (var i = 0; i < object.runs.length; ++i) { + if (typeof object.runs[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.runs: object expected"); + message.runs[i] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.fromObject(object.runs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ScheduleTransferRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} message ScheduleTransferRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduleTransferRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.runs = []; + if (message.runs && message.runs.length) { + object.runs = []; + for (var j = 0; j < message.runs.length; ++j) + object.runs[j] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.toObject(message.runs[j], options); + } + return object; + }; + + /** + * Converts this ScheduleTransferRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ScheduleTransferRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScheduleTransferRunsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleTransferRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse"; + }; + + return ScheduleTransferRunsResponse; + })(); + + v1.StartManualTransferRunsRequest = (function() { + + /** + * Properties of a StartManualTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IStartManualTransferRunsRequest + * @property {string|null} [parent] StartManualTransferRunsRequest parent + * @property {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange|null} [requestedTimeRange] StartManualTransferRunsRequest requestedTimeRange + * @property {google.protobuf.ITimestamp|null} [requestedRunTime] StartManualTransferRunsRequest requestedRunTime + */ + + /** + * Constructs a new StartManualTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a StartManualTransferRunsRequest. + * @implements IStartManualTransferRunsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest=} [properties] Properties to set + */ + function StartManualTransferRunsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartManualTransferRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @instance + */ + StartManualTransferRunsRequest.prototype.parent = ""; + + /** + * StartManualTransferRunsRequest requestedTimeRange. + * @member {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange|null|undefined} requestedTimeRange + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @instance + */ + StartManualTransferRunsRequest.prototype.requestedTimeRange = null; + + /** + * StartManualTransferRunsRequest requestedRunTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestedRunTime + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @instance + */ + StartManualTransferRunsRequest.prototype.requestedRunTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StartManualTransferRunsRequest time. + * @member {"requestedTimeRange"|"requestedRunTime"|undefined} time + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @instance + */ + Object.defineProperty(StartManualTransferRunsRequest.prototype, "time", { + get: $util.oneOfGetter($oneOfFields = ["requestedTimeRange", "requestedRunTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StartManualTransferRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest} StartManualTransferRunsRequest instance + */ + StartManualTransferRunsRequest.create = function create(properties) { + return new StartManualTransferRunsRequest(properties); + }; + + /** + * Encodes the specified StartManualTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest} message StartManualTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartManualTransferRunsRequest.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.requestedTimeRange != null && Object.hasOwnProperty.call(message, "requestedTimeRange")) + $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.encode(message.requestedTimeRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestedRunTime != null && Object.hasOwnProperty.call(message, "requestedRunTime")) + $root.google.protobuf.Timestamp.encode(message.requestedRunTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StartManualTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest} message StartManualTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartManualTransferRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartManualTransferRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest} StartManualTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartManualTransferRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.requestedTimeRange = $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestedRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartManualTransferRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest} StartManualTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartManualTransferRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartManualTransferRunsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartManualTransferRunsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requestedTimeRange != null && message.hasOwnProperty("requestedTimeRange")) { + properties.time = 1; + { + var error = $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.verify(message.requestedTimeRange); + if (error) + return "requestedTimeRange." + error; + } + } + if (message.requestedRunTime != null && message.hasOwnProperty("requestedRunTime")) { + if (properties.time === 1) + return "time: multiple values"; + properties.time = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.requestedRunTime); + if (error) + return "requestedRunTime." + error; + } + } + return null; + }; + + /** + * Creates a StartManualTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest} StartManualTransferRunsRequest + */ + StartManualTransferRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestedTimeRange != null) { + if (typeof object.requestedTimeRange !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.requestedTimeRange: object expected"); + message.requestedTimeRange = $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.fromObject(object.requestedTimeRange); + } + if (object.requestedRunTime != null) { + if (typeof object.requestedRunTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.requestedRunTime: object expected"); + message.requestedRunTime = $root.google.protobuf.Timestamp.fromObject(object.requestedRunTime); + } + return message; + }; + + /** + * Creates a plain object from a StartManualTransferRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest} message StartManualTransferRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartManualTransferRunsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestedTimeRange != null && message.hasOwnProperty("requestedTimeRange")) { + object.requestedTimeRange = $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.toObject(message.requestedTimeRange, options); + if (options.oneofs) + object.time = "requestedTimeRange"; + } + if (message.requestedRunTime != null && message.hasOwnProperty("requestedRunTime")) { + object.requestedRunTime = $root.google.protobuf.Timestamp.toObject(message.requestedRunTime, options); + if (options.oneofs) + object.time = "requestedRunTime"; + } + return object; + }; + + /** + * Converts this StartManualTransferRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @instance + * @returns {Object.} JSON object + */ + StartManualTransferRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartManualTransferRunsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartManualTransferRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest"; + }; + + StartManualTransferRunsRequest.TimeRange = (function() { + + /** + * Properties of a TimeRange. + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @interface ITimeRange + * @property {google.protobuf.ITimestamp|null} [startTime] TimeRange startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeRange endTime + */ + + /** + * Constructs a new TimeRange. + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @classdesc Represents a TimeRange. + * @implements ITimeRange + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange=} [properties] Properties to set + */ + function TimeRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeRange startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @instance + */ + TimeRange.prototype.startTime = null; + + /** + * TimeRange endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @instance + */ + TimeRange.prototype.endTime = null; + + /** + * Creates a new TimeRange instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} TimeRange instance + */ + TimeRange.create = function create(properties) { + return new TimeRange(properties); + }; + + /** + * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange} message TimeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeRange.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 TimeRange message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange} message TimeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange(); + 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 TimeRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeRange message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeRange.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 TimeRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} TimeRange + */ + TimeRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimeRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} message TimeRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeRange.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 TimeRange to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @instance + * @returns {Object.} JSON object + */ + TimeRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeRange + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange"; + }; + + return TimeRange; + })(); + + return StartManualTransferRunsRequest; + })(); + + v1.StartManualTransferRunsResponse = (function() { + + /** + * Properties of a StartManualTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IStartManualTransferRunsResponse + * @property {Array.|null} [runs] StartManualTransferRunsResponse runs + */ + + /** + * Constructs a new StartManualTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a StartManualTransferRunsResponse. + * @implements IStartManualTransferRunsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse=} [properties] Properties to set + */ + function StartManualTransferRunsResponse(properties) { + this.runs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartManualTransferRunsResponse runs. + * @member {Array.} runs + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @instance + */ + StartManualTransferRunsResponse.prototype.runs = $util.emptyArray; + + /** + * Creates a new StartManualTransferRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} StartManualTransferRunsResponse instance + */ + StartManualTransferRunsResponse.create = function create(properties) { + return new StartManualTransferRunsResponse(properties); + }; + + /** + * Encodes the specified StartManualTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse} message StartManualTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartManualTransferRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runs != null && message.runs.length) + for (var i = 0; i < message.runs.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.TransferRun.encode(message.runs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StartManualTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse} message StartManualTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartManualTransferRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartManualTransferRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} StartManualTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartManualTransferRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.runs && message.runs.length)) + message.runs = []; + message.runs.push($root.google.cloud.bigquery.datatransfer.v1.TransferRun.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartManualTransferRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} StartManualTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartManualTransferRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartManualTransferRunsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartManualTransferRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runs != null && message.hasOwnProperty("runs")) { + if (!Array.isArray(message.runs)) + return "runs: array expected"; + for (var i = 0; i < message.runs.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.verify(message.runs[i]); + if (error) + return "runs." + error; + } + } + return null; + }; + + /** + * Creates a StartManualTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} StartManualTransferRunsResponse + */ + StartManualTransferRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse(); + if (object.runs) { + if (!Array.isArray(object.runs)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.runs: array expected"); + message.runs = []; + for (var i = 0; i < object.runs.length; ++i) { + if (typeof object.runs[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.runs: object expected"); + message.runs[i] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.fromObject(object.runs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StartManualTransferRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} message StartManualTransferRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartManualTransferRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.runs = []; + if (message.runs && message.runs.length) { + object.runs = []; + for (var j = 0; j < message.runs.length; ++j) + object.runs[j] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.toObject(message.runs[j], options); + } + return object; + }; + + /** + * Converts this StartManualTransferRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @instance + * @returns {Object.} JSON object + */ + StartManualTransferRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartManualTransferRunsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartManualTransferRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse"; + }; + + return StartManualTransferRunsResponse; + })(); + + v1.EnrollDataSourcesRequest = (function() { + + /** + * Properties of an EnrollDataSourcesRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IEnrollDataSourcesRequest + * @property {string|null} [name] EnrollDataSourcesRequest name + * @property {Array.|null} [dataSourceIds] EnrollDataSourcesRequest dataSourceIds + */ + + /** + * Constructs a new EnrollDataSourcesRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents an EnrollDataSourcesRequest. + * @implements IEnrollDataSourcesRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest=} [properties] Properties to set + */ + function EnrollDataSourcesRequest(properties) { + this.dataSourceIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnrollDataSourcesRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @instance + */ + EnrollDataSourcesRequest.prototype.name = ""; + + /** + * EnrollDataSourcesRequest dataSourceIds. + * @member {Array.} dataSourceIds + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @instance + */ + EnrollDataSourcesRequest.prototype.dataSourceIds = $util.emptyArray; + + /** + * Creates a new EnrollDataSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest} EnrollDataSourcesRequest instance + */ + EnrollDataSourcesRequest.create = function create(properties) { + return new EnrollDataSourcesRequest(properties); + }; + + /** + * Encodes the specified EnrollDataSourcesRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest} message EnrollDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnrollDataSourcesRequest.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.dataSourceIds != null && message.dataSourceIds.length) + for (var i = 0; i < message.dataSourceIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSourceIds[i]); + return writer; + }; + + /** + * Encodes the specified EnrollDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest} message EnrollDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnrollDataSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnrollDataSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest} EnrollDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnrollDataSourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.dataSourceIds && message.dataSourceIds.length)) + message.dataSourceIds = []; + message.dataSourceIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnrollDataSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest} EnrollDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnrollDataSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnrollDataSourcesRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnrollDataSourcesRequest.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.dataSourceIds != null && message.hasOwnProperty("dataSourceIds")) { + if (!Array.isArray(message.dataSourceIds)) + return "dataSourceIds: array expected"; + for (var i = 0; i < message.dataSourceIds.length; ++i) + if (!$util.isString(message.dataSourceIds[i])) + return "dataSourceIds: string[] expected"; + } + return null; + }; + + /** + * Creates an EnrollDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest} EnrollDataSourcesRequest + */ + EnrollDataSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.dataSourceIds) { + if (!Array.isArray(object.dataSourceIds)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest.dataSourceIds: array expected"); + message.dataSourceIds = []; + for (var i = 0; i < object.dataSourceIds.length; ++i) + message.dataSourceIds[i] = String(object.dataSourceIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnrollDataSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest} message EnrollDataSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnrollDataSourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataSourceIds = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataSourceIds && message.dataSourceIds.length) { + object.dataSourceIds = []; + for (var j = 0; j < message.dataSourceIds.length; ++j) + object.dataSourceIds[j] = message.dataSourceIds[j]; + } + return object; + }; + + /** + * Converts this EnrollDataSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + EnrollDataSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnrollDataSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnrollDataSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest"; + }; + + return EnrollDataSourcesRequest; + })(); + + /** + * TransferType enum. + * @name google.cloud.bigquery.datatransfer.v1.TransferType + * @enum {number} + * @property {number} TRANSFER_TYPE_UNSPECIFIED=0 TRANSFER_TYPE_UNSPECIFIED value + * @property {number} BATCH=1 BATCH value + * @property {number} STREAMING=2 STREAMING value + */ + v1.TransferType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSFER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BATCH"] = 1; + values[valuesById[2] = "STREAMING"] = 2; + return values; + })(); + + /** + * TransferState enum. + * @name google.cloud.bigquery.datatransfer.v1.TransferState + * @enum {number} + * @property {number} TRANSFER_STATE_UNSPECIFIED=0 TRANSFER_STATE_UNSPECIFIED value + * @property {number} PENDING=2 PENDING value + * @property {number} RUNNING=3 RUNNING value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} FAILED=5 FAILED value + * @property {number} CANCELLED=6 CANCELLED value + */ + v1.TransferState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSFER_STATE_UNSPECIFIED"] = 0; + values[valuesById[2] = "PENDING"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "CANCELLED"] = 6; + return values; + })(); + + v1.EmailPreferences = (function() { + + /** + * Properties of an EmailPreferences. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IEmailPreferences + * @property {boolean|null} [enableFailureEmail] EmailPreferences enableFailureEmail + */ + + /** + * Constructs a new EmailPreferences. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents an EmailPreferences. + * @implements IEmailPreferences + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences=} [properties] Properties to set + */ + function EmailPreferences(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmailPreferences enableFailureEmail. + * @member {boolean} enableFailureEmail + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @instance + */ + EmailPreferences.prototype.enableFailureEmail = false; + + /** + * Creates a new EmailPreferences instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences instance + */ + EmailPreferences.create = function create(properties) { + return new EmailPreferences(properties); + }; + + /** + * Encodes the specified EmailPreferences message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences} message EmailPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmailPreferences.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableFailureEmail != null && Object.hasOwnProperty.call(message, "enableFailureEmail")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableFailureEmail); + return writer; + }; + + /** + * Encodes the specified EmailPreferences message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences} message EmailPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmailPreferences.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmailPreferences.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableFailureEmail = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmailPreferences.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmailPreferences message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmailPreferences.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableFailureEmail != null && message.hasOwnProperty("enableFailureEmail")) + if (typeof message.enableFailureEmail !== "boolean") + return "enableFailureEmail: boolean expected"; + return null; + }; + + /** + * Creates an EmailPreferences message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences + */ + EmailPreferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences(); + if (object.enableFailureEmail != null) + message.enableFailureEmail = Boolean(object.enableFailureEmail); + return message; + }; + + /** + * Creates a plain object from an EmailPreferences message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.EmailPreferences} message EmailPreferences + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmailPreferences.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableFailureEmail = false; + if (message.enableFailureEmail != null && message.hasOwnProperty("enableFailureEmail")) + object.enableFailureEmail = message.enableFailureEmail; + return object; + }; + + /** + * Converts this EmailPreferences to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @instance + * @returns {Object.} JSON object + */ + EmailPreferences.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmailPreferences + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmailPreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.EmailPreferences"; + }; + + return EmailPreferences; + })(); + + v1.ScheduleOptions = (function() { + + /** + * Properties of a ScheduleOptions. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IScheduleOptions + * @property {boolean|null} [disableAutoScheduling] ScheduleOptions disableAutoScheduling + * @property {google.protobuf.ITimestamp|null} [startTime] ScheduleOptions startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ScheduleOptions endTime + */ + + /** + * Constructs a new ScheduleOptions. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ScheduleOptions. + * @implements IScheduleOptions + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleOptions=} [properties] Properties to set + */ + function ScheduleOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScheduleOptions disableAutoScheduling. + * @member {boolean} disableAutoScheduling + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @instance + */ + ScheduleOptions.prototype.disableAutoScheduling = false; + + /** + * ScheduleOptions startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @instance + */ + ScheduleOptions.prototype.startTime = null; + + /** + * ScheduleOptions endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @instance + */ + ScheduleOptions.prototype.endTime = null; + + /** + * Creates a new ScheduleOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleOptions} ScheduleOptions instance + */ + ScheduleOptions.create = function create(properties) { + return new ScheduleOptions(properties); + }; + + /** + * Encodes the specified ScheduleOptions message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleOptions} message ScheduleOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleOptions.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(); + if (message.disableAutoScheduling != null && Object.hasOwnProperty.call(message, "disableAutoScheduling")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disableAutoScheduling); + return writer; + }; + + /** + * Encodes the specified ScheduleOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleOptions} message ScheduleOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduleOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleOptions} ScheduleOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.disableAutoScheduling = reader.bool(); + break; + } + 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 ScheduleOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleOptions} ScheduleOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduleOptions message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduleOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disableAutoScheduling != null && message.hasOwnProperty("disableAutoScheduling")) + if (typeof message.disableAutoScheduling !== "boolean") + return "disableAutoScheduling: boolean 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 ScheduleOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleOptions} ScheduleOptions + */ + ScheduleOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions(); + if (object.disableAutoScheduling != null) + message.disableAutoScheduling = Boolean(object.disableAutoScheduling); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleOptions.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleOptions.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a ScheduleOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ScheduleOptions} message ScheduleOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduleOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.disableAutoScheduling = false; + } + 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); + if (message.disableAutoScheduling != null && message.hasOwnProperty("disableAutoScheduling")) + object.disableAutoScheduling = message.disableAutoScheduling; + return object; + }; + + /** + * Converts this ScheduleOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @instance + * @returns {Object.} JSON object + */ + ScheduleOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScheduleOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ScheduleOptions"; + }; + + return ScheduleOptions; + })(); + + v1.UserInfo = (function() { + + /** + * Properties of a UserInfo. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IUserInfo + * @property {string|null} [email] UserInfo email + */ + + /** + * Constructs a new UserInfo. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a UserInfo. + * @implements IUserInfo + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IUserInfo=} [properties] Properties to set + */ + function UserInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserInfo email. + * @member {string|null|undefined} email + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @instance + */ + UserInfo.prototype.email = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UserInfo _email. + * @member {"email"|undefined} _email + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @instance + */ + Object.defineProperty(UserInfo.prototype, "_email", { + get: $util.oneOfGetter($oneOfFields = ["email"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UserInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUserInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.UserInfo} UserInfo instance + */ + UserInfo.create = function create(properties) { + return new UserInfo(properties); + }; + + /** + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UserInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUserInfo} message UserInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + return writer; + }; + + /** + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UserInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUserInfo} message UserInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.UserInfo} UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.UserInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.UserInfo} UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserInfo message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.email != null && message.hasOwnProperty("email")) { + properties._email = 1; + if (!$util.isString(message.email)) + return "email: string expected"; + } + return null; + }; + + /** + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.UserInfo} UserInfo + */ + UserInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.UserInfo) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.UserInfo(); + if (object.email != null) + message.email = String(object.email); + return message; + }; + + /** + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {google.cloud.bigquery.datatransfer.v1.UserInfo} message UserInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.email != null && message.hasOwnProperty("email")) { + object.email = message.email; + if (options.oneofs) + object._email = "email"; + } + return object; + }; + + /** + * Converts this UserInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @instance + * @returns {Object.} JSON object + */ + UserInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.UserInfo"; + }; + + return UserInfo; + })(); + + v1.TransferConfig = (function() { + + /** + * Properties of a TransferConfig. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ITransferConfig + * @property {string|null} [name] TransferConfig name + * @property {string|null} [destinationDatasetId] TransferConfig destinationDatasetId + * @property {string|null} [displayName] TransferConfig displayName + * @property {string|null} [dataSourceId] TransferConfig dataSourceId + * @property {google.protobuf.IStruct|null} [params] TransferConfig params + * @property {string|null} [schedule] TransferConfig schedule + * @property {google.cloud.bigquery.datatransfer.v1.IScheduleOptions|null} [scheduleOptions] TransferConfig scheduleOptions + * @property {number|null} [dataRefreshWindowDays] TransferConfig dataRefreshWindowDays + * @property {boolean|null} [disabled] TransferConfig disabled + * @property {google.protobuf.ITimestamp|null} [updateTime] TransferConfig updateTime + * @property {google.protobuf.ITimestamp|null} [nextRunTime] TransferConfig nextRunTime + * @property {google.cloud.bigquery.datatransfer.v1.TransferState|null} [state] TransferConfig state + * @property {number|Long|null} [userId] TransferConfig userId + * @property {string|null} [datasetRegion] TransferConfig datasetRegion + * @property {string|null} [notificationPubsubTopic] TransferConfig notificationPubsubTopic + * @property {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null} [emailPreferences] TransferConfig emailPreferences + * @property {google.cloud.bigquery.datatransfer.v1.IUserInfo|null} [ownerInfo] TransferConfig ownerInfo + */ + + /** + * Constructs a new TransferConfig. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a TransferConfig. + * @implements ITransferConfig + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ITransferConfig=} [properties] Properties to set + */ + function TransferConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferConfig name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.name = ""; + + /** + * TransferConfig destinationDatasetId. + * @member {string|null|undefined} destinationDatasetId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.destinationDatasetId = null; + + /** + * TransferConfig displayName. + * @member {string} displayName + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.displayName = ""; + + /** + * TransferConfig dataSourceId. + * @member {string} dataSourceId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.dataSourceId = ""; + + /** + * TransferConfig params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.params = null; + + /** + * TransferConfig schedule. + * @member {string} schedule + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.schedule = ""; + + /** + * TransferConfig scheduleOptions. + * @member {google.cloud.bigquery.datatransfer.v1.IScheduleOptions|null|undefined} scheduleOptions + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.scheduleOptions = null; + + /** + * TransferConfig dataRefreshWindowDays. + * @member {number} dataRefreshWindowDays + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.dataRefreshWindowDays = 0; + + /** + * TransferConfig disabled. + * @member {boolean} disabled + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.disabled = false; + + /** + * TransferConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.updateTime = null; + + /** + * TransferConfig nextRunTime. + * @member {google.protobuf.ITimestamp|null|undefined} nextRunTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.nextRunTime = null; + + /** + * TransferConfig state. + * @member {google.cloud.bigquery.datatransfer.v1.TransferState} state + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.state = 0; + + /** + * TransferConfig userId. + * @member {number|Long} userId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.userId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferConfig datasetRegion. + * @member {string} datasetRegion + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.datasetRegion = ""; + + /** + * TransferConfig notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.notificationPubsubTopic = ""; + + /** + * TransferConfig emailPreferences. + * @member {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null|undefined} emailPreferences + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.emailPreferences = null; + + /** + * TransferConfig ownerInfo. + * @member {google.cloud.bigquery.datatransfer.v1.IUserInfo|null|undefined} ownerInfo + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.ownerInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransferConfig destination. + * @member {"destinationDatasetId"|undefined} destination + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + Object.defineProperty(TransferConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["destinationDatasetId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TransferConfig _ownerInfo. + * @member {"ownerInfo"|undefined} _ownerInfo + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + Object.defineProperty(TransferConfig.prototype, "_ownerInfo", { + get: $util.oneOfGetter($oneOfFields = ["ownerInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransferConfig instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferConfig=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.TransferConfig} TransferConfig instance + */ + TransferConfig.create = function create(properties) { + return new TransferConfig(properties); + }; + + /** + * Encodes the specified TransferConfig message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferConfig} message TransferConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferConfig.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.destinationDatasetId != null && Object.hasOwnProperty.call(message, "destinationDatasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationDatasetId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.dataSourceId != null && Object.hasOwnProperty.call(message, "dataSourceId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.dataSourceId); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.schedule); + if (message.nextRunTime != null && Object.hasOwnProperty.call(message, "nextRunTime")) + $root.google.protobuf.Timestamp.encode(message.nextRunTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.userId); + if (message.dataRefreshWindowDays != null && Object.hasOwnProperty.call(message, "dataRefreshWindowDays")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.dataRefreshWindowDays); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.disabled); + if (message.datasetRegion != null && Object.hasOwnProperty.call(message, "datasetRegion")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.datasetRegion); + if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.notificationPubsubTopic); + if (message.emailPreferences != null && Object.hasOwnProperty.call(message, "emailPreferences")) + $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.encode(message.emailPreferences, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.scheduleOptions != null && Object.hasOwnProperty.call(message, "scheduleOptions")) + $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.encode(message.scheduleOptions, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.ownerInfo != null && Object.hasOwnProperty.call(message, "ownerInfo")) + $root.google.cloud.bigquery.datatransfer.v1.UserInfo.encode(message.ownerInfo, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferConfig message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferConfig} message TransferConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.TransferConfig} TransferConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.TransferConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.destinationDatasetId = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 5: { + message.dataSourceId = reader.string(); + break; + } + case 9: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 7: { + message.schedule = reader.string(); + break; + } + case 24: { + message.scheduleOptions = $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.decode(reader, reader.uint32()); + break; + } + case 12: { + message.dataRefreshWindowDays = reader.int32(); + break; + } + case 13: { + message.disabled = reader.bool(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.nextRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.userId = reader.int64(); + break; + } + case 14: { + message.datasetRegion = reader.string(); + break; + } + case 15: { + message.notificationPubsubTopic = reader.string(); + break; + } + case 18: { + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.decode(reader, reader.uint32()); + break; + } + case 27: { + message.ownerInfo = $root.google.cloud.bigquery.datatransfer.v1.UserInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.TransferConfig} TransferConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferConfig message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferConfig.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.destinationDatasetId != null && message.hasOwnProperty("destinationDatasetId")) { + properties.destination = 1; + if (!$util.isString(message.destinationDatasetId)) + return "destinationDatasetId: string expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + if (!$util.isString(message.dataSourceId)) + return "dataSourceId: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) + if (!$util.isString(message.schedule)) + return "schedule: string expected"; + if (message.scheduleOptions != null && message.hasOwnProperty("scheduleOptions")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.verify(message.scheduleOptions); + if (error) + return "scheduleOptions." + error; + } + if (message.dataRefreshWindowDays != null && message.hasOwnProperty("dataRefreshWindowDays")) + if (!$util.isInteger(message.dataRefreshWindowDays)) + return "dataRefreshWindowDays: integer expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.nextRunTime != null && message.hasOwnProperty("nextRunTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.nextRunTime); + if (error) + return "nextRunTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isInteger(message.userId) && !(message.userId && $util.isInteger(message.userId.low) && $util.isInteger(message.userId.high))) + return "userId: integer|Long expected"; + if (message.datasetRegion != null && message.hasOwnProperty("datasetRegion")) + if (!$util.isString(message.datasetRegion)) + return "datasetRegion: string expected"; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify(message.emailPreferences); + if (error) + return "emailPreferences." + error; + } + if (message.ownerInfo != null && message.hasOwnProperty("ownerInfo")) { + properties._ownerInfo = 1; + { + var error = $root.google.cloud.bigquery.datatransfer.v1.UserInfo.verify(message.ownerInfo); + if (error) + return "ownerInfo." + error; + } + } + return null; + }; + + /** + * Creates a TransferConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.TransferConfig} TransferConfig + */ + TransferConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.TransferConfig) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.TransferConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.destinationDatasetId != null) + message.destinationDatasetId = String(object.destinationDatasetId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.dataSourceId != null) + message.dataSourceId = String(object.dataSourceId); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.schedule != null) + message.schedule = String(object.schedule); + if (object.scheduleOptions != null) { + if (typeof object.scheduleOptions !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.scheduleOptions: object expected"); + message.scheduleOptions = $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.fromObject(object.scheduleOptions); + } + if (object.dataRefreshWindowDays != null) + message.dataRefreshWindowDays = object.dataRefreshWindowDays | 0; + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.nextRunTime != null) { + if (typeof object.nextRunTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.nextRunTime: object expected"); + message.nextRunTime = $root.google.protobuf.Timestamp.fromObject(object.nextRunTime); + } + switch (object.state) { + case "TRANSFER_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "CANCELLED": + case 6: + message.state = 6; + break; + } + if (object.userId != null) + if ($util.Long) + (message.userId = $util.Long.fromValue(object.userId)).unsigned = false; + else if (typeof object.userId === "string") + message.userId = parseInt(object.userId, 10); + else if (typeof object.userId === "number") + message.userId = object.userId; + else if (typeof object.userId === "object") + message.userId = new $util.LongBits(object.userId.low >>> 0, object.userId.high >>> 0).toNumber(); + if (object.datasetRegion != null) + message.datasetRegion = String(object.datasetRegion); + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + if (object.emailPreferences != null) { + if (typeof object.emailPreferences !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.emailPreferences: object expected"); + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.fromObject(object.emailPreferences); + } + if (object.ownerInfo != null) { + if (typeof object.ownerInfo !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.ownerInfo: object expected"); + message.ownerInfo = $root.google.cloud.bigquery.datatransfer.v1.UserInfo.fromObject(object.ownerInfo); + } + return message; + }; + + /** + * Creates a plain object from a TransferConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} message TransferConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.updateTime = null; + object.dataSourceId = ""; + object.schedule = ""; + object.nextRunTime = null; + object.params = null; + object.state = options.enums === String ? "TRANSFER_STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.userId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.userId = options.longs === String ? "0" : 0; + object.dataRefreshWindowDays = 0; + object.disabled = false; + object.datasetRegion = ""; + object.notificationPubsubTopic = ""; + object.emailPreferences = null; + object.scheduleOptions = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.destinationDatasetId != null && message.hasOwnProperty("destinationDatasetId")) { + object.destinationDatasetId = message.destinationDatasetId; + if (options.oneofs) + object.destination = "destinationDatasetId"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + object.dataSourceId = message.dataSourceId; + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = message.schedule; + if (message.nextRunTime != null && message.hasOwnProperty("nextRunTime")) + object.nextRunTime = $root.google.protobuf.Timestamp.toObject(message.nextRunTime, options); + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferState[message.state] : message.state; + if (message.userId != null && message.hasOwnProperty("userId")) + if (typeof message.userId === "number") + object.userId = options.longs === String ? String(message.userId) : message.userId; + else + object.userId = options.longs === String ? $util.Long.prototype.toString.call(message.userId) : options.longs === Number ? new $util.LongBits(message.userId.low >>> 0, message.userId.high >>> 0).toNumber() : message.userId; + if (message.dataRefreshWindowDays != null && message.hasOwnProperty("dataRefreshWindowDays")) + object.dataRefreshWindowDays = message.dataRefreshWindowDays; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + if (message.datasetRegion != null && message.hasOwnProperty("datasetRegion")) + object.datasetRegion = message.datasetRegion; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) + object.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.toObject(message.emailPreferences, options); + if (message.scheduleOptions != null && message.hasOwnProperty("scheduleOptions")) + object.scheduleOptions = $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.toObject(message.scheduleOptions, options); + if (message.ownerInfo != null && message.hasOwnProperty("ownerInfo")) { + object.ownerInfo = $root.google.cloud.bigquery.datatransfer.v1.UserInfo.toObject(message.ownerInfo, options); + if (options.oneofs) + object._ownerInfo = "ownerInfo"; + } + return object; + }; + + /** + * Converts this TransferConfig to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + * @returns {Object.} JSON object + */ + TransferConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferConfig + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.TransferConfig"; + }; + + return TransferConfig; + })(); + + v1.TransferRun = (function() { + + /** + * Properties of a TransferRun. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ITransferRun + * @property {string|null} [name] TransferRun name + * @property {google.protobuf.ITimestamp|null} [scheduleTime] TransferRun scheduleTime + * @property {google.protobuf.ITimestamp|null} [runTime] TransferRun runTime + * @property {google.rpc.IStatus|null} [errorStatus] TransferRun errorStatus + * @property {google.protobuf.ITimestamp|null} [startTime] TransferRun startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TransferRun endTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TransferRun updateTime + * @property {google.protobuf.IStruct|null} [params] TransferRun params + * @property {string|null} [destinationDatasetId] TransferRun destinationDatasetId + * @property {string|null} [dataSourceId] TransferRun dataSourceId + * @property {google.cloud.bigquery.datatransfer.v1.TransferState|null} [state] TransferRun state + * @property {number|Long|null} [userId] TransferRun userId + * @property {string|null} [schedule] TransferRun schedule + * @property {string|null} [notificationPubsubTopic] TransferRun notificationPubsubTopic + * @property {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null} [emailPreferences] TransferRun emailPreferences + */ + + /** + * Constructs a new TransferRun. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a TransferRun. + * @implements ITransferRun + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ITransferRun=} [properties] Properties to set + */ + function TransferRun(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferRun name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.name = ""; + + /** + * TransferRun scheduleTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.scheduleTime = null; + + /** + * TransferRun runTime. + * @member {google.protobuf.ITimestamp|null|undefined} runTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.runTime = null; + + /** + * TransferRun errorStatus. + * @member {google.rpc.IStatus|null|undefined} errorStatus + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.errorStatus = null; + + /** + * TransferRun startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.startTime = null; + + /** + * TransferRun endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.endTime = null; + + /** + * TransferRun updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.updateTime = null; + + /** + * TransferRun params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.params = null; + + /** + * TransferRun destinationDatasetId. + * @member {string|null|undefined} destinationDatasetId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.destinationDatasetId = null; + + /** + * TransferRun dataSourceId. + * @member {string} dataSourceId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.dataSourceId = ""; + + /** + * TransferRun state. + * @member {google.cloud.bigquery.datatransfer.v1.TransferState} state + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.state = 0; + + /** + * TransferRun userId. + * @member {number|Long} userId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.userId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferRun schedule. + * @member {string} schedule + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.schedule = ""; + + /** + * TransferRun notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.notificationPubsubTopic = ""; + + /** + * TransferRun emailPreferences. + * @member {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null|undefined} emailPreferences + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.emailPreferences = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransferRun destination. + * @member {"destinationDatasetId"|undefined} destination + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + Object.defineProperty(TransferRun.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["destinationDatasetId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransferRun instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferRun=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.TransferRun} TransferRun instance + */ + TransferRun.create = function create(properties) { + return new TransferRun(properties); + }; + + /** + * Encodes the specified TransferRun message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferRun} message TransferRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferRun.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.destinationDatasetId != null && Object.hasOwnProperty.call(message, "destinationDatasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationDatasetId); + if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) + $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, 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.dataSourceId != null && Object.hasOwnProperty.call(message, "dataSourceId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.dataSourceId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.runTime != null && Object.hasOwnProperty.call(message, "runTime")) + $root.google.protobuf.Timestamp.encode(message.runTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.userId); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.schedule); + if (message.errorStatus != null && Object.hasOwnProperty.call(message, "errorStatus")) + $root.google.rpc.Status.encode(message.errorStatus, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.notificationPubsubTopic); + if (message.emailPreferences != null && Object.hasOwnProperty.call(message, "emailPreferences")) + $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.encode(message.emailPreferences, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferRun message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferRun} message TransferRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.TransferRun} TransferRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.TransferRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.runTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 21: { + message.errorStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 2: { + message.destinationDatasetId = reader.string(); + break; + } + case 7: { + message.dataSourceId = reader.string(); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 11: { + message.userId = reader.int64(); + break; + } + case 12: { + message.schedule = reader.string(); + break; + } + case 23: { + message.notificationPubsubTopic = reader.string(); + break; + } + case 25: { + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.TransferRun} TransferRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferRun message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferRun.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.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); + if (error) + return "scheduleTime." + error; + } + if (message.runTime != null && message.hasOwnProperty("runTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.runTime); + if (error) + return "runTime." + error; + } + if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) { + var error = $root.google.rpc.Status.verify(message.errorStatus); + if (error) + return "errorStatus." + error; + } + 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; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.destinationDatasetId != null && message.hasOwnProperty("destinationDatasetId")) { + properties.destination = 1; + if (!$util.isString(message.destinationDatasetId)) + return "destinationDatasetId: string expected"; + } + if (message.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + if (!$util.isString(message.dataSourceId)) + return "dataSourceId: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isInteger(message.userId) && !(message.userId && $util.isInteger(message.userId.low) && $util.isInteger(message.userId.high))) + return "userId: integer|Long expected"; + if (message.schedule != null && message.hasOwnProperty("schedule")) + if (!$util.isString(message.schedule)) + return "schedule: string expected"; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify(message.emailPreferences); + if (error) + return "emailPreferences." + error; + } + return null; + }; + + /** + * Creates a TransferRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.TransferRun} TransferRun + */ + TransferRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.TransferRun) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.TransferRun(); + if (object.name != null) + message.name = String(object.name); + if (object.scheduleTime != null) { + if (typeof object.scheduleTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.scheduleTime: object expected"); + message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); + } + if (object.runTime != null) { + if (typeof object.runTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.runTime: object expected"); + message.runTime = $root.google.protobuf.Timestamp.fromObject(object.runTime); + } + if (object.errorStatus != null) { + if (typeof object.errorStatus !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.errorStatus: object expected"); + message.errorStatus = $root.google.rpc.Status.fromObject(object.errorStatus); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.destinationDatasetId != null) + message.destinationDatasetId = String(object.destinationDatasetId); + if (object.dataSourceId != null) + message.dataSourceId = String(object.dataSourceId); + switch (object.state) { + case "TRANSFER_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "CANCELLED": + case 6: + message.state = 6; + break; + } + if (object.userId != null) + if ($util.Long) + (message.userId = $util.Long.fromValue(object.userId)).unsigned = false; + else if (typeof object.userId === "string") + message.userId = parseInt(object.userId, 10); + else if (typeof object.userId === "number") + message.userId = object.userId; + else if (typeof object.userId === "object") + message.userId = new $util.LongBits(object.userId.low >>> 0, object.userId.high >>> 0).toNumber(); + if (object.schedule != null) + message.schedule = String(object.schedule); + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + if (object.emailPreferences != null) { + if (typeof object.emailPreferences !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.emailPreferences: object expected"); + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.fromObject(object.emailPreferences); + } + return message; + }; + + /** + * Creates a plain object from a TransferRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {google.cloud.bigquery.datatransfer.v1.TransferRun} message TransferRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.scheduleTime = null; + object.startTime = null; + object.endTime = null; + object.updateTime = null; + object.dataSourceId = ""; + object.state = options.enums === String ? "TRANSFER_STATE_UNSPECIFIED" : 0; + object.params = null; + object.runTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.userId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.userId = options.longs === String ? "0" : 0; + object.schedule = ""; + object.errorStatus = null; + object.notificationPubsubTopic = ""; + object.emailPreferences = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.destinationDatasetId != null && message.hasOwnProperty("destinationDatasetId")) { + object.destinationDatasetId = message.destinationDatasetId; + if (options.oneofs) + object.destination = "destinationDatasetId"; + } + if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) + object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); + 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); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + object.dataSourceId = message.dataSourceId; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferState[message.state] : message.state; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + if (message.runTime != null && message.hasOwnProperty("runTime")) + object.runTime = $root.google.protobuf.Timestamp.toObject(message.runTime, options); + if (message.userId != null && message.hasOwnProperty("userId")) + if (typeof message.userId === "number") + object.userId = options.longs === String ? String(message.userId) : message.userId; + else + object.userId = options.longs === String ? $util.Long.prototype.toString.call(message.userId) : options.longs === Number ? new $util.LongBits(message.userId.low >>> 0, message.userId.high >>> 0).toNumber() : message.userId; + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = message.schedule; + if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) + object.errorStatus = $root.google.rpc.Status.toObject(message.errorStatus, options); + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) + object.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.toObject(message.emailPreferences, options); + return object; + }; + + /** + * Converts this TransferRun to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + * @returns {Object.} JSON object + */ + TransferRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferRun + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.TransferRun"; + }; + + return TransferRun; + })(); + + v1.TransferMessage = (function() { + + /** + * Properties of a TransferMessage. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ITransferMessage + * @property {google.protobuf.ITimestamp|null} [messageTime] TransferMessage messageTime + * @property {google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity|null} [severity] TransferMessage severity + * @property {string|null} [messageText] TransferMessage messageText + */ + + /** + * Constructs a new TransferMessage. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a TransferMessage. + * @implements ITransferMessage + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ITransferMessage=} [properties] Properties to set + */ + function TransferMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferMessage messageTime. + * @member {google.protobuf.ITimestamp|null|undefined} messageTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @instance + */ + TransferMessage.prototype.messageTime = null; + + /** + * TransferMessage severity. + * @member {google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity} severity + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @instance + */ + TransferMessage.prototype.severity = 0; + + /** + * TransferMessage messageText. + * @member {string} messageText + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @instance + */ + TransferMessage.prototype.messageText = ""; + + /** + * Creates a new TransferMessage instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferMessage=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.TransferMessage} TransferMessage instance + */ + TransferMessage.create = function create(properties) { + return new TransferMessage(properties); + }; + + /** + * Encodes the specified TransferMessage message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferMessage} message TransferMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageTime != null && Object.hasOwnProperty.call(message, "messageTime")) + $root.google.protobuf.Timestamp.encode(message.messageTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.severity); + if (message.messageText != null && Object.hasOwnProperty.call(message, "messageText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.messageText); + return writer; + }; + + /** + * Encodes the specified TransferMessage message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferMessage} message TransferMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.TransferMessage} TransferMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.TransferMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.severity = reader.int32(); + break; + } + case 3: { + message.messageText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.TransferMessage} TransferMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferMessage message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageTime != null && message.hasOwnProperty("messageTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.messageTime); + if (error) + return "messageTime." + error; + } + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.messageText != null && message.hasOwnProperty("messageText")) + if (!$util.isString(message.messageText)) + return "messageText: string expected"; + return null; + }; + + /** + * Creates a TransferMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.TransferMessage} TransferMessage + */ + TransferMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.TransferMessage) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.TransferMessage(); + if (object.messageTime != null) { + if (typeof object.messageTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferMessage.messageTime: object expected"); + message.messageTime = $root.google.protobuf.Timestamp.fromObject(object.messageTime); + } + switch (object.severity) { + case "MESSAGE_SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "INFO": + case 1: + message.severity = 1; + break; + case "WARNING": + case 2: + message.severity = 2; + break; + case "ERROR": + case 3: + message.severity = 3; + break; + } + if (object.messageText != null) + message.messageText = String(object.messageText); + return message; + }; + + /** + * Creates a plain object from a TransferMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {google.cloud.bigquery.datatransfer.v1.TransferMessage} message TransferMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.messageTime = null; + object.severity = options.enums === String ? "MESSAGE_SEVERITY_UNSPECIFIED" : 0; + object.messageText = ""; + } + if (message.messageTime != null && message.hasOwnProperty("messageTime")) + object.messageTime = $root.google.protobuf.Timestamp.toObject(message.messageTime, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity[message.severity] : message.severity; + if (message.messageText != null && message.hasOwnProperty("messageText")) + object.messageText = message.messageText; + return object; + }; + + /** + * Converts this TransferMessage to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @instance + * @returns {Object.} JSON object + */ + TransferMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferMessage + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.TransferMessage"; + }; + + /** + * MessageSeverity enum. + * @name google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity + * @enum {number} + * @property {number} MESSAGE_SEVERITY_UNSPECIFIED=0 MESSAGE_SEVERITY_UNSPECIFIED value + * @property {number} INFO=1 INFO value + * @property {number} WARNING=2 WARNING value + * @property {number} ERROR=3 ERROR value + */ + TransferMessage.MessageSeverity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "INFO"] = 1; + values[valuesById[2] = "WARNING"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return TransferMessage; + })(); + + return v1; + })(); + + return datatransfer; + })(); + + return bigquery; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + 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: + 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] : 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]] : 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) { + 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) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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) { + 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] : 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) { + 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) { + 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: + 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] : 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] : 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]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + 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] : 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.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + return protobuf; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.json b/packages/google-cloud-bigquery-datatransfer/protos/protos.json new file mode 100644 index 00000000000..0c10300be09 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.json @@ -0,0 +1,2651 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "bigquery": { + "nested": { + "datatransfer": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.BigQuery.DataTransfer.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer", + "java_multiple_files": true, + "java_outer_classname": "TransferProto", + "java_package": "com.google.cloud.bigquery.datatransfer.v1", + "php_namespace": "Google\\Cloud\\BigQuery\\DataTransfer\\V1", + "ruby_package": "Google::Cloud::Bigquery::DataTransfer::V1", + "objc_class_prefix": "GCBDT" + }, + "nested": { + "DataTransferService": { + "options": { + "(google.api.default_host)": "bigquerydatatransfer.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetDataSource": { + "requestType": "GetDataSourceRequest", + "responseType": "DataSource", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/dataSources/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/dataSources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/dataSources/*}", + "additional_bindings": { + "get": "/v1/{name=projects/*/dataSources/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDataSources": { + "requestType": "ListDataSourcesRequest", + "responseType": "ListDataSourcesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/dataSources", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/dataSources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/dataSources", + "additional_bindings": { + "get": "/v1/{parent=projects/*}/dataSources" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateTransferConfig": { + "requestType": "CreateTransferConfigRequest", + "responseType": "TransferConfig", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/transferConfigs", + "(google.api.http).body": "transfer_config", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/transferConfigs", + "(google.api.http).additional_bindings.body": "transfer_config", + "(google.api.method_signature)": "parent,transfer_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/transferConfigs", + "body": "transfer_config", + "additional_bindings": { + "post": "/v1/{parent=projects/*}/transferConfigs", + "body": "transfer_config" + } + } + }, + { + "(google.api.method_signature)": "parent,transfer_config" + } + ] + }, + "UpdateTransferConfig": { + "requestType": "UpdateTransferConfigRequest", + "responseType": "TransferConfig", + "options": { + "(google.api.http).patch": "/v1/{transfer_config.name=projects/*/locations/*/transferConfigs/*}", + "(google.api.http).body": "transfer_config", + "(google.api.http).additional_bindings.patch": "/v1/{transfer_config.name=projects/*/transferConfigs/*}", + "(google.api.http).additional_bindings.body": "transfer_config", + "(google.api.method_signature)": "transfer_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{transfer_config.name=projects/*/locations/*/transferConfigs/*}", + "body": "transfer_config", + "additional_bindings": { + "patch": "/v1/{transfer_config.name=projects/*/transferConfigs/*}", + "body": "transfer_config" + } + } + }, + { + "(google.api.method_signature)": "transfer_config,update_mask" + } + ] + }, + "DeleteTransferConfig": { + "requestType": "DeleteTransferConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/transferConfigs/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/transferConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/transferConfigs/*}", + "additional_bindings": { + "delete": "/v1/{name=projects/*/transferConfigs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetTransferConfig": { + "requestType": "GetTransferConfigRequest", + "responseType": "TransferConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/transferConfigs/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/transferConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/transferConfigs/*}", + "additional_bindings": { + "get": "/v1/{name=projects/*/transferConfigs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTransferConfigs": { + "requestType": "ListTransferConfigsRequest", + "responseType": "ListTransferConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/transferConfigs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/transferConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/transferConfigs", + "additional_bindings": { + "get": "/v1/{parent=projects/*}/transferConfigs" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ScheduleTransferRuns": { + "requestType": "ScheduleTransferRunsRequest", + "responseType": "ScheduleTransferRunsResponse", + "options": { + "deprecated": true, + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/transferConfigs/*}:scheduleRuns", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/transferConfigs/*}:scheduleRuns", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,start_time,end_time" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/transferConfigs/*}:scheduleRuns", + "body": "*", + "additional_bindings": { + "post": "/v1/{parent=projects/*/transferConfigs/*}:scheduleRuns", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,start_time,end_time" + } + ] + }, + "StartManualTransferRuns": { + "requestType": "StartManualTransferRunsRequest", + "responseType": "StartManualTransferRunsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/transferConfigs/*}:startManualRuns", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/transferConfigs/*}:startManualRuns", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/transferConfigs/*}:startManualRuns", + "body": "*", + "additional_bindings": { + "post": "/v1/{parent=projects/*/transferConfigs/*}:startManualRuns", + "body": "*" + } + } + } + ] + }, + "GetTransferRun": { + "requestType": "GetTransferRunRequest", + "responseType": "TransferRun", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/transferConfigs/*/runs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}", + "additional_bindings": { + "get": "/v1/{name=projects/*/transferConfigs/*/runs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteTransferRun": { + "requestType": "DeleteTransferRunRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/transferConfigs/*/runs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}", + "additional_bindings": { + "delete": "/v1/{name=projects/*/transferConfigs/*/runs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTransferRuns": { + "requestType": "ListTransferRunsRequest", + "responseType": "ListTransferRunsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/transferConfigs/*}/runs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/transferConfigs/*}/runs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/transferConfigs/*}/runs", + "additional_bindings": { + "get": "/v1/{parent=projects/*/transferConfigs/*}/runs" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListTransferLogs": { + "requestType": "ListTransferLogsRequest", + "responseType": "ListTransferLogsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/transferConfigs/*/runs/*}/transferLogs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/transferConfigs/*/runs/*}/transferLogs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/transferConfigs/*/runs/*}/transferLogs", + "additional_bindings": { + "get": "/v1/{parent=projects/*/transferConfigs/*/runs/*}/transferLogs" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CheckValidCreds": { + "requestType": "CheckValidCredsRequest", + "responseType": "CheckValidCredsResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/dataSources/*}:checkValidCreds", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/dataSources/*}:checkValidCreds", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/dataSources/*}:checkValidCreds", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*/dataSources/*}:checkValidCreds", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "EnrollDataSources": { + "requestType": "EnrollDataSourcesRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*}:enrollDataSources", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*}:enrollDataSources", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*}:enrollDataSources", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*}:enrollDataSources", + "body": "*" + } + } + } + ] + } + } + }, + "DataSourceParameter": { + "fields": { + "paramId": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "type": { + "type": "Type", + "id": 4 + }, + "required": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + }, + "validationRegex": { + "type": "string", + "id": 7 + }, + "allowedValues": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "minValue": { + "type": "google.protobuf.DoubleValue", + "id": 9 + }, + "maxValue": { + "type": "google.protobuf.DoubleValue", + "id": 10 + }, + "fields": { + "rule": "repeated", + "type": "DataSourceParameter", + "id": 11 + }, + "validationDescription": { + "type": "string", + "id": 12 + }, + "validationHelpUrl": { + "type": "string", + "id": 13 + }, + "immutable": { + "type": "bool", + "id": 14 + }, + "recurse": { + "type": "bool", + "id": 15 + }, + "deprecated": { + "type": "bool", + "id": 20 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INTEGER": 2, + "DOUBLE": 3, + "BOOLEAN": 4, + "RECORD": 5, + "PLUS_PAGE": 6 + } + } + } + }, + "DataSource": { + "options": { + "(google.api.resource).type": "bigquerydatatransfer.googleapis.com/DataSource", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dataSources/{data_source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSourceId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + }, + "clientId": { + "type": "string", + "id": 5 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "transferType": { + "type": "TransferType", + "id": 7, + "options": { + "deprecated": true + } + }, + "supportsMultipleTransfers": { + "type": "bool", + "id": 8, + "options": { + "deprecated": true + } + }, + "updateDeadlineSeconds": { + "type": "int32", + "id": 9 + }, + "defaultSchedule": { + "type": "string", + "id": 10 + }, + "supportsCustomSchedule": { + "type": "bool", + "id": 11 + }, + "parameters": { + "rule": "repeated", + "type": "DataSourceParameter", + "id": 12 + }, + "helpUrl": { + "type": "string", + "id": 13 + }, + "authorizationType": { + "type": "AuthorizationType", + "id": 14 + }, + "dataRefreshType": { + "type": "DataRefreshType", + "id": 15 + }, + "defaultDataRefreshWindowDays": { + "type": "int32", + "id": 16 + }, + "manualRunsDisabled": { + "type": "bool", + "id": 17 + }, + "minimumScheduleInterval": { + "type": "google.protobuf.Duration", + "id": 18 + } + }, + "nested": { + "AuthorizationType": { + "values": { + "AUTHORIZATION_TYPE_UNSPECIFIED": 0, + "AUTHORIZATION_CODE": 1, + "GOOGLE_PLUS_AUTHORIZATION_CODE": 2, + "FIRST_PARTY_OAUTH": 3 + } + }, + "DataRefreshType": { + "values": { + "DATA_REFRESH_TYPE_UNSPECIFIED": 0, + "SLIDING_WINDOW": 1, + "CUSTOM_SLIDING_WINDOW": 2 + } + } + } + }, + "GetDataSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/DataSource" + } + } + } + }, + "ListDataSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/DataSource" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + } + } + }, + "ListDataSourcesResponse": { + "fields": { + "dataSources": { + "rule": "repeated", + "type": "DataSource", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CreateTransferConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + }, + "transferConfig": { + "type": "TransferConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authorizationCode": { + "type": "string", + "id": 3 + }, + "versionInfo": { + "type": "string", + "id": 5 + }, + "serviceAccountName": { + "type": "string", + "id": 6 + } + } + }, + "UpdateTransferConfigRequest": { + "fields": { + "transferConfig": { + "type": "TransferConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authorizationCode": { + "type": "string", + "id": 3 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "versionInfo": { + "type": "string", + "id": 5 + }, + "serviceAccountName": { + "type": "string", + "id": 6 + } + } + }, + "GetTransferConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + } + } + }, + "DeleteTransferConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + } + } + }, + "GetTransferRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/Run" + } + } + } + }, + "DeleteTransferRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/Run" + } + } + } + }, + "ListTransferConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + }, + "dataSourceIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + } + } + }, + "ListTransferConfigsResponse": { + "fields": { + "transferConfigs": { + "rule": "repeated", + "type": "TransferConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListTransferRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/Run" + } + }, + "states": { + "rule": "repeated", + "type": "TransferState", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "runAttempt": { + "type": "RunAttempt", + "id": 5 + } + }, + "nested": { + "RunAttempt": { + "values": { + "RUN_ATTEMPT_UNSPECIFIED": 0, + "LATEST": 1 + } + } + } + }, + "ListTransferRunsResponse": { + "fields": { + "transferRuns": { + "rule": "repeated", + "type": "TransferRun", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListTransferLogsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/Run" + } + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "pageSize": { + "type": "int32", + "id": 5 + }, + "messageTypes": { + "rule": "repeated", + "type": "TransferMessage.MessageSeverity", + "id": 6 + } + } + }, + "ListTransferLogsResponse": { + "fields": { + "transferMessages": { + "rule": "repeated", + "type": "TransferMessage", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CheckValidCredsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/DataSource" + } + } + } + }, + "CheckValidCredsResponse": { + "fields": { + "hasValidCreds": { + "type": "bool", + "id": 1 + } + } + }, + "ScheduleTransferRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ScheduleTransferRunsResponse": { + "fields": { + "runs": { + "rule": "repeated", + "type": "TransferRun", + "id": 1 + } + } + }, + "StartManualTransferRunsRequest": { + "oneofs": { + "time": { + "oneof": [ + "requestedTimeRange", + "requestedRunTime" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + }, + "requestedTimeRange": { + "type": "TimeRange", + "id": 3 + }, + "requestedRunTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + }, + "nested": { + "TimeRange": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + }, + "StartManualTransferRunsResponse": { + "fields": { + "runs": { + "rule": "repeated", + "type": "TransferRun", + "id": 1 + } + } + }, + "EnrollDataSourcesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "dataSourceIds": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "TransferType": { + "options": { + "deprecated": true + }, + "values": { + "TRANSFER_TYPE_UNSPECIFIED": 0, + "BATCH": 1, + "STREAMING": 2 + } + }, + "TransferState": { + "values": { + "TRANSFER_STATE_UNSPECIFIED": 0, + "PENDING": 2, + "RUNNING": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "CANCELLED": 6 + } + }, + "EmailPreferences": { + "fields": { + "enableFailureEmail": { + "type": "bool", + "id": 1 + } + } + }, + "ScheduleOptions": { + "fields": { + "disableAutoScheduling": { + "type": "bool", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "UserInfo": { + "oneofs": { + "_email": { + "oneof": [ + "email" + ] + } + }, + "fields": { + "email": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "TransferConfig": { + "options": { + "(google.api.resource).type": "bigquerydatatransfer.googleapis.com/TransferConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/transferConfigs/{transfer_config}" + }, + "oneofs": { + "destination": { + "oneof": [ + "destinationDatasetId" + ] + }, + "_ownerInfo": { + "oneof": [ + "ownerInfo" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "destinationDatasetId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "dataSourceId": { + "type": "string", + "id": 5 + }, + "params": { + "type": "google.protobuf.Struct", + "id": 9 + }, + "schedule": { + "type": "string", + "id": 7 + }, + "scheduleOptions": { + "type": "ScheduleOptions", + "id": 24 + }, + "dataRefreshWindowDays": { + "type": "int32", + "id": 12 + }, + "disabled": { + "type": "bool", + "id": 13 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextRunTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "TransferState", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userId": { + "type": "int64", + "id": 11 + }, + "datasetRegion": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "notificationPubsubTopic": { + "type": "string", + "id": 15 + }, + "emailPreferences": { + "type": "EmailPreferences", + "id": 18 + }, + "ownerInfo": { + "type": "UserInfo", + "id": 27, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "TransferRun": { + "options": { + "(google.api.resource).type": "bigquerydatatransfer.googleapis.com/Run", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}" + }, + "oneofs": { + "destination": { + "oneof": [ + "destinationDatasetId" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "scheduleTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "runTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "errorStatus": { + "type": "google.rpc.Status", + "id": 21 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "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" + } + }, + "params": { + "type": "google.protobuf.Struct", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "destinationDatasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSourceId": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "TransferState", + "id": 8 + }, + "userId": { + "type": "int64", + "id": 11 + }, + "schedule": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "notificationPubsubTopic": { + "type": "string", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "emailPreferences": { + "type": "EmailPreferences", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TransferMessage": { + "fields": { + "messageTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "severity": { + "type": "MessageSeverity", + "id": 2 + }, + "messageText": { + "type": "string", + "id": 3 + } + }, + "nested": { + "MessageSeverity": { + "values": { + "MESSAGE_SEVERITY_UNSPECIFIED": 0, + "INFO": 1, + "WARNING": 2, + "ERROR": 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 + } + }, + "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 + } + } + } + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datatransfer/samples/.eslintrc.yml b/packages/google-cloud-bigquery-datatransfer/samples/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-bigquery-datatransfer/samples/README.md b/packages/google-cloud-bigquery-datatransfer/samples/README.md new file mode 100644 index 00000000000..9199f3ac6fc --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/README.md @@ -0,0 +1,338 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google BigQuery Data Transfer Service: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Data_transfer_service.check_valid_creds](#data_transfer_service.check_valid_creds) + * [Data_transfer_service.create_transfer_config](#data_transfer_service.create_transfer_config) + * [Data_transfer_service.delete_transfer_config](#data_transfer_service.delete_transfer_config) + * [Data_transfer_service.delete_transfer_run](#data_transfer_service.delete_transfer_run) + * [Data_transfer_service.enroll_data_sources](#data_transfer_service.enroll_data_sources) + * [Data_transfer_service.get_data_source](#data_transfer_service.get_data_source) + * [Data_transfer_service.get_transfer_config](#data_transfer_service.get_transfer_config) + * [Data_transfer_service.get_transfer_run](#data_transfer_service.get_transfer_run) + * [Data_transfer_service.list_data_sources](#data_transfer_service.list_data_sources) + * [Data_transfer_service.list_transfer_configs](#data_transfer_service.list_transfer_configs) + * [Data_transfer_service.list_transfer_logs](#data_transfer_service.list_transfer_logs) + * [Data_transfer_service.list_transfer_runs](#data_transfer_service.list_transfer_runs) + * [Data_transfer_service.schedule_transfer_runs](#data_transfer_service.schedule_transfer_runs) + * [Data_transfer_service.start_manual_transfer_runs](#data_transfer_service.start_manual_transfer_runs) + * [Data_transfer_service.update_transfer_config](#data_transfer_service.update_transfer_config) + * [Quickstart](#quickstart) + * [Quickstart.test](#quickstart.test) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Data_transfer_service.check_valid_creds + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js` + + +----- + + + + +### Data_transfer_service.create_transfer_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js` + + +----- + + + + +### Data_transfer_service.delete_transfer_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js` + + +----- + + + + +### Data_transfer_service.delete_transfer_run + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js` + + +----- + + + + +### Data_transfer_service.enroll_data_sources + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js` + + +----- + + + + +### Data_transfer_service.get_data_source + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js` + + +----- + + + + +### Data_transfer_service.get_transfer_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js` + + +----- + + + + +### Data_transfer_service.get_transfer_run + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js` + + +----- + + + + +### Data_transfer_service.list_data_sources + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js` + + +----- + + + + +### Data_transfer_service.list_transfer_configs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js` + + +----- + + + + +### Data_transfer_service.list_transfer_logs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js` + + +----- + + + + +### Data_transfer_service.list_transfer_runs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js` + + +----- + + + + +### Data_transfer_service.schedule_transfer_runs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js` + + +----- + + + + +### Data_transfer_service.start_manual_transfer_runs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js` + + +----- + + + + +### Data_transfer_service.update_transfer_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/quickstart.js` + + +----- + + + + +### Quickstart.test + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/bigquery/transfer/ diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js new file mode 100644 index 00000000000..91dd765c211 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_CheckValidCreds_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 data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callCheckValidCreds() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.checkValidCreds(request); + console.log(response); + } + + callCheckValidCreds(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_CheckValidCreds_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js new file mode 100644 index 00000000000..a2ddfb165b1 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js @@ -0,0 +1,103 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, transferConfig) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_CreateTransferConfig_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 BigQuery project id where the transfer configuration should be created. + * Must be in the format projects/{project_id}/locations/{location_id} or + * projects/{project_id}. If specified location and location of the + * destination bigquery dataset do not match - the request will fail. + */ + // const parent = 'abc123' + /** + * Required. Data transfer configuration to create. + */ + // const transferConfig = {} + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required if new credentials are needed, as indicated by + * `CheckValidCreds`. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + // const authorizationCode = 'abc123' + /** + * Optional version info. If users want to find a very recent access token, + * that is, immediately after approving access, users have to set the + * version_info claim in the token request. To obtain the version_info, users + * must use the "none+gsession" response type. which be return a + * version_info back in the authorization response which be be put in a JWT + * claim in the token request. + */ + // const versionInfo = 'abc123' + /** + * Optional service account name. If this field is set, transfer config will + * be created with this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. + */ + // const serviceAccountName = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callCreateTransferConfig() { + // Construct request + const request = { + parent, + transferConfig, + }; + + // Run request + const response = await datatransferClient.createTransferConfig(request); + console.log(response); + } + + callCreateTransferConfig(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_CreateTransferConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js new file mode 100644 index 00000000000..40dd46f8912 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferConfig_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 field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callDeleteTransferConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.deleteTransferConfig(request); + console.log(response); + } + + callDeleteTransferConfig(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js new file mode 100644 index 00000000000..3b280391e6c --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferRun_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 field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callDeleteTransferRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.deleteTransferRun(request); + console.log(response); + } + + callDeleteTransferRun(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js new file mode 100644 index 00000000000..e0553ce148a --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START bigquerydatatransfer_v1_generated_DataTransferService_EnrollDataSources_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 project resource in the form: + * `projects/{project_id}` + */ + // const name = 'abc123' + /** + * Data sources that are enrolled. It is required to provide at least one + * data source id. + */ + // const dataSourceIds = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callEnrollDataSources() { + // Construct request + const request = { + }; + + // Run request + const response = await datatransferClient.enrollDataSources(request); + console.log(response); + } + + callEnrollDataSources(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_EnrollDataSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js new file mode 100644 index 00000000000..da7418e8ae4 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_GetDataSource_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 field will contain name of the resource requested, for example: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callGetDataSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.getDataSource(request); + console.log(response); + } + + callGetDataSource(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_GetDataSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js new file mode 100644 index 00000000000..bf650372409 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_GetTransferConfig_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 field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callGetTransferConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.getTransferConfig(request); + console.log(response); + } + + callGetTransferConfig(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_GetTransferConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js new file mode 100644 index 00000000000..698698e38a5 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_GetTransferRun_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 field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callGetTransferRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.getTransferRun(request); + console.log(response); + } + + callGetTransferRun(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_GetTransferRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js new file mode 100644 index 00000000000..516866b4bc9 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.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(parent) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_ListDataSources_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 BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id} + */ + // const parent = 'abc123' + /** + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + // const pageToken = 'abc123' + /** + * Page size. The default page size is the maximum value of 1000 results. + */ + // const pageSize = 1234 + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callListDataSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datatransferClient.listDataSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataSources(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_ListDataSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js new file mode 100644 index 00000000000..9e4f144680a --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_ListTransferConfigs_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 BigQuery project id for which data sources + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + */ + // const parent = 'abc123' + /** + * When specified, only configurations of requested data sources are returned. + */ + // const dataSourceIds = 'abc123' + /** + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + // const pageToken = 'abc123' + /** + * Page size. The default page size is the maximum value of 1000 results. + */ + // const pageSize = 1234 + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callListTransferConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datatransferClient.listTransferConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransferConfigs(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js new file mode 100644 index 00000000000..e6828957ffb --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js @@ -0,0 +1,82 @@ +// 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 bigquerydatatransfer_v1_generated_DataTransferService_ListTransferLogs_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. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + // const parent = 'abc123' + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + // const pageToken = 'abc123' + /** + * Page size. The default page size is the maximum value of 1000 results. + */ + // const pageSize = 1234 + /** + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + */ + // const messageTypes = 1234 + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callListTransferLogs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datatransferClient.listTransferLogsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransferLogs(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferLogs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js new file mode 100644 index 00000000000..a16ee7806ce --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_ListTransferRuns_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 transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + */ + // const parent = 'abc123' + /** + * When specified, only transfer runs with requested states are returned. + */ + // const states = 1234 + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + // const pageToken = 'abc123' + /** + * Page size. The default page size is the maximum value of 1000 results. + */ + // const pageSize = 1234 + /** + * Indicates how run attempts are to be pulled. + */ + // const runAttempt = {} + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callListTransferRuns() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datatransferClient.listTransferRunsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransferRuns(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js new file mode 100644 index 00000000000..a7ab3cccdae --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, startTime, endTime) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_ScheduleTransferRuns_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. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + */ + // const parent = 'abc123' + /** + * Required. Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + */ + // const startTime = {} + /** + * Required. End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + */ + // const endTime = {} + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callScheduleTransferRuns() { + // Construct request + const request = { + parent, + startTime, + endTime, + }; + + // Run request + const response = await datatransferClient.scheduleTransferRuns(request); + console.log(response); + } + + callScheduleTransferRuns(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_ScheduleTransferRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js new file mode 100644 index 00000000000..acff4f9bfb2 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.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() { + // [START bigquerydatatransfer_v1_generated_DataTransferService_StartManualTransferRuns_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. + */ + /** + * Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + */ + // const parent = 'abc123' + /** + * Time range for the transfer runs that should be started. + */ + // const requestedTimeRange = {} + /** + * Specific run_time for a transfer run to be started. The + * requested_run_time must not be in the future. + */ + // const requestedRunTime = {} + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callStartManualTransferRuns() { + // Construct request + const request = { + }; + + // Run request + const response = await datatransferClient.startManualTransferRuns(request); + console.log(response); + } + + callStartManualTransferRuns(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_StartManualTransferRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js new file mode 100644 index 00000000000..f6e55317a09 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js @@ -0,0 +1,101 @@ +// 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(transferConfig, updateMask) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_UpdateTransferConfig_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. Data transfer configuration to create. + */ + // const transferConfig = {} + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * If it is provided, the transfer configuration will be associated with the + * authorizing user. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + // const authorizationCode = 'abc123' + /** + * Required. Required list of fields to be updated in this request. + */ + // const updateMask = {} + /** + * Optional version info. If users want to find a very recent access token, + * that is, immediately after approving access, users have to set the + * version_info claim in the token request. To obtain the version_info, users + * must use the "none+gsession" response type. which be return a + * version_info back in the authorization response which be be put in a JWT + * claim in the token request. + */ + // const versionInfo = 'abc123' + /** + * Optional service account name. If this field is set and + * "service_account_name" is set in update_mask, transfer config will be + * updated to use this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. + */ + // const serviceAccountName = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callUpdateTransferConfig() { + // Construct request + const request = { + transferConfig, + updateMask, + }; + + // Run request + const response = await datatransferClient.updateTransferConfig(request); + console.log(response); + } + + callUpdateTransferConfig(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_UpdateTransferConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json new file mode 100644 index 00000000000..376c09e28a0 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json @@ -0,0 +1,715 @@ +{ + "clientLibrary": { + "name": "nodejs-datatransfer", + "version": "3.1.3", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.bigquery.datatransfer.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_GetDataSource_async", + "title": "DataTransferService getDataSource Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a supported data source and returns its settings.", + "canonical": true, + "file": "data_transfer_service.get_data_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataSource", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetDataSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.DataSource", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "GetDataSource", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetDataSource", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_ListDataSources_async", + "title": "DataTransferService listDataSources Sample", + "origin": "API_DEFINITION", + "description": " Lists supported data sources and returns their settings.", + "canonical": true, + "file": "data_transfer_service.list_data_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDataSources", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListDataSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "ListDataSources", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListDataSources", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_CreateTransferConfig_async", + "title": "DataTransferService createTransferConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a new data transfer configuration.", + "canonical": true, + "file": "data_transfer_service.create_transfer_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 95, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.CreateTransferConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "transfer_config", + "type": ".google.cloud.bigquery.datatransfer.v1.TransferConfig" + }, + { + "name": "authorization_code", + "type": "TYPE_STRING" + }, + { + "name": "version_info", + "type": "TYPE_STRING" + }, + { + "name": "service_account_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.TransferConfig", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "CreateTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.CreateTransferConfig", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_UpdateTransferConfig_async", + "title": "DataTransferService updateTransferConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a data transfer configuration. All fields must be set, even if they are not updated.", + "canonical": true, + "file": "data_transfer_service.update_transfer_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 93, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.UpdateTransferConfig", + "async": true, + "parameters": [ + { + "name": "transfer_config", + "type": ".google.cloud.bigquery.datatransfer.v1.TransferConfig" + }, + { + "name": "authorization_code", + "type": "TYPE_STRING" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "version_info", + "type": "TYPE_STRING" + }, + { + "name": "service_account_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.TransferConfig", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "UpdateTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.UpdateTransferConfig", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferConfig_async", + "title": "DataTransferService deleteTransferConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a data transfer configuration, including any associated transfer runs and logs.", + "canonical": true, + "file": "data_transfer_service.delete_transfer_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "DeleteTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferConfig", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_GetTransferConfig_async", + "title": "DataTransferService getTransferConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns information about a data transfer config.", + "canonical": true, + "file": "data_transfer_service.get_transfer_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.TransferConfig", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "GetTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferConfig", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_ListTransferConfigs_async", + "title": "DataTransferService listTransferConfigs Sample", + "origin": "API_DEFINITION", + "description": " Returns information about all transfer configs owned by a project in the specified location.", + "canonical": true, + "file": "data_transfer_service.list_transfer_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTransferConfigs", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "data_source_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "ListTransferConfigs", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferConfigs", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_ScheduleTransferRuns_async", + "title": "DataTransferService scheduleTransferRuns Sample", + "origin": "API_DEFINITION", + "description": " Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever granularity the data source supports - in the range, one transfer run is created. Note that runs are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns instead.", + "canonical": true, + "file": "data_transfer_service.schedule_transfer_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ScheduleTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ScheduleTransferRuns", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "end_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "ScheduleTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ScheduleTransferRuns", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_StartManualTransferRuns_async", + "title": "DataTransferService startManualTransferRuns Sample", + "origin": "API_DEFINITION", + "description": " Start manual transfer runs to be executed now with schedule_time equal to current time. The transfer runs can be created for a time range where the run_time is between start_time (inclusive) and end_time (exclusive), or for a specific run_time.", + "canonical": true, + "file": "data_transfer_service.start_manual_transfer_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartManualTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.StartManualTransferRuns", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requested_time_range", + "type": ".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange" + }, + { + "name": "requested_run_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "StartManualTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.StartManualTransferRuns", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_GetTransferRun_async", + "title": "DataTransferService getTransferRun Sample", + "origin": "API_DEFINITION", + "description": " Returns information about the particular transfer run.", + "canonical": true, + "file": "data_transfer_service.get_transfer_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTransferRun", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.TransferRun", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "GetTransferRun", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferRun", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferRun_async", + "title": "DataTransferService deleteTransferRun Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified transfer run.", + "canonical": true, + "file": "data_transfer_service.delete_transfer_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTransferRun", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "DeleteTransferRun", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferRun", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_ListTransferRuns_async", + "title": "DataTransferService listTransferRuns Sample", + "origin": "API_DEFINITION", + "description": " Returns information about running and completed transfer runs.", + "canonical": true, + "file": "data_transfer_service.list_transfer_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferRuns", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "states", + "type": "TYPE_ENUM[]" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "run_attempt", + "type": ".google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "ListTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferRuns", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_ListTransferLogs_async", + "title": "DataTransferService listTransferLogs Sample", + "origin": "API_DEFINITION", + "description": " Returns log messages for the transfer run.", + "canonical": true, + "file": "data_transfer_service.list_transfer_logs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTransferLogs", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferLogs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "message_types", + "type": "TYPE_ENUM[]" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "ListTransferLogs", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferLogs", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_CheckValidCreds_async", + "title": "DataTransferService checkValidCreds Sample", + "origin": "API_DEFINITION", + "description": " Returns true if valid credentials exist for the given data source and requesting user.", + "canonical": true, + "file": "data_transfer_service.check_valid_creds.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckValidCreds", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.CheckValidCreds", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "CheckValidCreds", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.CheckValidCreds", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_EnrollDataSources_async", + "title": "DataTransferService enrollDataSources Sample", + "origin": "API_DEFINITION", + "description": " Enroll data sources in a user project. This allows users to create transfer configurations for these data sources. They will also appear in the ListDataSources RPC and as such, will appear in the BigQuery UI 'https://bigquery.cloud.google.com' (and the documents can be found at https://cloud.google.com/bigquery/bigquery-web-ui and https://cloud.google.com/bigquery/docs/working-with-transfers).", + "canonical": true, + "file": "data_transfer_service.enroll_data_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnrollDataSources", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.EnrollDataSources", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "data_source_ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "EnrollDataSources", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.EnrollDataSources", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datatransfer/samples/package.json b/packages/google-cloud-bigquery-datatransfer/samples/package.json new file mode 100644 index 00000000000..e4456c379eb --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-docs-samples-bigquery-data-transfer", + "license": "Apache-2.0", + "author": "Google Inc.", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "repository": "googleapis/nodejs-bigquery-data-transfer", + "private": true, + "scripts": { + "test": "mocha --timeout 60000" + }, + "dependencies": { + "@google-cloud/bigquery-data-transfer": "^3.1.3" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/samples/quickstart.js b/packages/google-cloud-bigquery-datatransfer/samples/quickstart.js new file mode 100644 index 00000000000..f755a7663fa --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/quickstart.js @@ -0,0 +1,53 @@ +// Copyright 2017 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +// [START bigquerydatatransfer_quickstart] +const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer'); +const client = new bigqueryDataTransfer.v1.DataTransferServiceClient(); + +async function quickstart() { + const projectId = await client.getProjectId(); + + // Iterate over all elements. + const formattedParent = client.projectPath(projectId, 'us-central1'); + let nextRequest = {parent: formattedParent}; + const options = {autoPaginate: false}; + console.log('Data sources:'); + do { + // Fetch the next page. + const responses = await client.listDataSources(nextRequest, options); + // The actual resources in a response. + const resources = responses[0]; + // The next request if the response shows that there are more responses. + nextRequest = responses[1]; + // The actual response object, if necessary. + // const rawResponse = responses[2]; + resources.forEach(resource => { + console.log(` ${resource.name}`); + }); + } while (nextRequest); + + console.log('\n\n'); + console.log('Sources via stream:'); + + client + .listDataSourcesStream({parent: formattedParent}) + .on('data', element => { + console.log(` ${element.name}`); + }); +} +quickstart(); +// [END bigquerydatatransfer_quickstart] diff --git a/packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js b/packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js new file mode 100644 index 00000000000..ad0a7a8b39b --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js @@ -0,0 +1,28 @@ +// Copyright 2017 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it} = require('mocha'); +const cp = require('child_process'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +describe('quickstart', () => { + it('should return a list of resources', () => { + const stdout = execSync('node quickstart'); + assert.match(stdout, /^Data sources/); + }); +}); diff --git a/packages/google-cloud-bigquery-datatransfer/smoke-test/.eslintrc.yml b/packages/google-cloud-bigquery-datatransfer/smoke-test/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/smoke-test/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-bigquery-datatransfer/smoke-test/data_transfer_service_smoke_test.js b/packages/google-cloud-bigquery-datatransfer/smoke-test/data_transfer_service_smoke_test.js new file mode 100644 index 00000000000..15f915571d7 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/smoke-test/data_transfer_service_smoke_test.js @@ -0,0 +1,99 @@ +// 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. + +'use strict'; + +const {describe, it} = require('mocha'); + +describe('DataTransferServiceSmokeTest', () => { + if (!process.env.GCLOUD_PROJECT) { + throw new Error('Usage: GCLOUD_PROJECT= node #{$0}'); + } + const projectId = process.env.GCLOUD_PROJECT; + + it('successfully makes a call to the service using promises', done => { + // eslint-disable-next-line node/no-missing-require + const bigqueryDataTransfer = require('../src'); + + const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({ + // optional auth parameters. + }); + + // Iterate over all elements. + const formattedParent = client.locationPath(projectId, 'us-central1'); + + client + .listDataSources({parent: formattedParent}) + .then(responses => { + const resources = responses[0]; + for (const resource of resources) { + console.log(resource); + } + }) + .then(done) + .catch(done); + }); + + it('successfully makes a call to the service using callbacks', done => { + // eslint-disable-next-line node/no-missing-require + const bigqueryDataTransfer = require('../src'); + + const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({ + // optional auth parameters. + }); + + // Or obtain the paged response. + const formattedParent = client.locationPath(projectId, 'us-central1'); + + const options = {autoPaginate: false}; + const callback = responses => { + // The actual resources in a response. + const resources = responses[0]; + // The next request if the response shows that there are more responses. + const nextRequest = responses[1]; + // The actual response object, if necessary. + // const rawResponse = responses[2]; + for (const resource of resources) { + console.log(resource); + } + if (nextRequest) { + // Fetch the next page. + return client.listDataSources(nextRequest, options).then(callback); + } + }; + client + .listDataSources({parent: formattedParent}, options) + .then(callback) + .then(done) + .catch(done); + }); + + it('successfully makes a call to the service using streaming', done => { + // eslint-disable-next-line node/no-missing-require + const bigqueryDataTransfer = require('../src'); + + const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({ + // optional auth parameters. + }); + + const formattedParent = client.locationPath(projectId, 'us-central1'); + client + .listDataSourcesStream({parent: formattedParent}) + .on('data', element => { + console.log(element); + }) + .on('error', done) + .on('end', done); + }); +}); diff --git a/packages/google-cloud-bigquery-datatransfer/src/index.ts b/packages/google-cloud-bigquery-datatransfer/src/index.ts new file mode 100644 index 00000000000..dbd64da95fc --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const DataTransferServiceClient = v1.DataTransferServiceClient; +type DataTransferServiceClient = v1.DataTransferServiceClient; + +export {v1, DataTransferServiceClient}; +export default {v1, DataTransferServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts new file mode 100644 index 00000000000..8095cc77edf --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts @@ -0,0 +1,2831 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/data_transfer_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './data_transfer_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This API allows users to manage their data transfers into BigQuery. + * @class + * @memberof v1 + */ +export class DataTransferServiceClient { + 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}; + dataTransferServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataTransferServiceClient. + * + * @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 DataTransferServiceClient({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 DataTransferServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectDataSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/dataSources/{data_source}' + ), + projectLocationDataSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataSources/{data_source}' + ), + projectLocationTransferConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/transferConfigs/{transfer_config}' + ), + projectLocationTransferConfigRunPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}' + ), + projectTransferConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/transferConfigs/{transfer_config}' + ), + projectTransferConfigRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/transferConfigs/{transfer_config}/runs/{run}' + ), + }; + + // 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 = { + listDataSources: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dataSources' + ), + listTransferConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'transferConfigs' + ), + listTransferRuns: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'transferRuns' + ), + listTransferLogs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'transferMessages' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.datatransfer.v1.DataTransferService', + 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.dataTransferServiceStub) { + return this.dataTransferServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.datatransfer.v1.DataTransferService. + this.dataTransferServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.datatransfer.v1.DataTransferService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.datatransfer.v1 + .DataTransferService, + 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 dataTransferServiceStubMethods = [ + 'getDataSource', + 'listDataSources', + 'createTransferConfig', + 'updateTransferConfig', + 'deleteTransferConfig', + 'getTransferConfig', + 'listTransferConfigs', + 'scheduleTransferRuns', + 'startManualTransferRuns', + 'getTransferRun', + 'deleteTransferRun', + 'listTransferRuns', + 'listTransferLogs', + 'checkValidCreds', + 'enrollDataSources', + ]; + for (const methodName of dataTransferServiceStubMethods) { + const callPromise = this.dataTransferServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.dataTransferServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'bigquerydatatransfer.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 'bigquerydatatransfer.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 -- + // ------------------- + /** + * Retrieves a supported data source and returns its settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [DataSource]{@link google.cloud.bigquery.datatransfer.v1.DataSource}. + * 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/data_transfer_service.get_data_source.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_GetDataSource_async + */ + getDataSource( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | undefined + ), + {} | undefined + ] + >; + getDataSource( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataSource( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataSource( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | 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.getDataSource(request, options, callback); + } + /** + * Creates a new data transfer configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The BigQuery project id where the transfer configuration should be created. + * Must be in the format projects/{project_id}/locations/{location_id} or + * projects/{project_id}. If specified location and location of the + * destination bigquery dataset do not match - the request will fail. + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} request.transferConfig + * Required. Data transfer configuration to create. + * @param {string} request.authorizationCode + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required if new credentials are needed, as indicated by + * `CheckValidCreds`. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + * @param {string} request.versionInfo + * Optional version info. If users want to find a very recent access token, + * that is, immediately after approving access, users have to set the + * version_info claim in the token request. To obtain the version_info, users + * must use the "none+gsession" response type. which be return a + * version_info back in the authorization response which be be put in a JWT + * claim in the token request. + * @param {string} request.serviceAccountName + * Optional service account name. If this field is set, transfer config will + * be created with this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. + * @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 [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig}. + * 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/data_transfer_service.create_transfer_config.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_CreateTransferConfig_async + */ + createTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | undefined + ), + {} | undefined + ] + >; + createTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | 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.createTransferConfig(request, options, callback); + } + /** + * Updates a data transfer configuration. + * All fields must be set, even if they are not updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} request.transferConfig + * Required. Data transfer configuration to create. + * @param {string} request.authorizationCode + * Optional OAuth2 authorization code to use with this transfer configuration. + * If it is provided, the transfer configuration will be associated with the + * authorizing user. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Required list of fields to be updated in this request. + * @param {string} request.versionInfo + * Optional version info. If users want to find a very recent access token, + * that is, immediately after approving access, users have to set the + * version_info claim in the token request. To obtain the version_info, users + * must use the "none+gsession" response type. which be return a + * version_info back in the authorization response which be be put in a JWT + * claim in the token request. + * @param {string} request.serviceAccountName + * Optional service account name. If this field is set and + * "service_account_name" is set in update_mask, transfer config will be + * updated to use this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. + * @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 [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig}. + * 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/data_transfer_service.update_transfer_config.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_UpdateTransferConfig_async + */ + updateTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | 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({ + 'transfer_config.name': request.transferConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTransferConfig(request, options, callback); + } + /** + * Deletes a data transfer configuration, including any associated transfer + * runs and logs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.delete_transfer_config.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferConfig_async + */ + deleteTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | 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.deleteTransferConfig(request, options, callback); + } + /** + * Returns information about a data transfer config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig}. + * 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/data_transfer_service.get_transfer_config.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_GetTransferConfig_async + */ + getTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | undefined + ), + {} | undefined + ] + >; + getTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | 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.getTransferConfig(request, options, callback); + } + /** + * Creates transfer runs for a time range [start_time, end_time]. + * For each date - or whatever granularity the data source supports - in the + * range, one transfer run is created. + * Note that runs are created per UTC time in the time range. + * DEPRECATED: use StartManualTransferRuns instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @param {google.protobuf.Timestamp} request.startTime + * Required. Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + * @param {google.protobuf.Timestamp} request.endTime + * Required. End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + * @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 [ScheduleTransferRunsResponse]{@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse}. + * 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/data_transfer_service.schedule_transfer_runs.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_ScheduleTransferRuns_async + * @deprecated ScheduleTransferRuns is deprecated and may be removed in a future version. + */ + scheduleTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | undefined + ), + {} | undefined + ] + >; + scheduleTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + scheduleTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + scheduleTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | 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(); + this.warn( + 'DEP$DataTransferService-$ScheduleTransferRuns', + 'ScheduleTransferRuns is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); + return this.innerApiCalls.scheduleTransferRuns(request, options, callback); + } + /** + * Start manual transfer runs to be executed now with schedule_time equal to + * current time. The transfer runs can be created for a time range where the + * run_time is between start_time (inclusive) and end_time (exclusive), or for + * a specific run_time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} request.requestedTimeRange + * Time range for the transfer runs that should be started. + * @param {google.protobuf.Timestamp} request.requestedRunTime + * Specific run_time for a transfer run to be started. The + * requested_run_time must not be in the future. + * @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 [StartManualTransferRunsResponse]{@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse}. + * 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/data_transfer_service.start_manual_transfer_runs.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_StartManualTransferRuns_async + */ + startManualTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | undefined + ), + {} | undefined + ] + >; + startManualTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + startManualTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + startManualTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | 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.startManualTransferRuns( + request, + options, + callback + ); + } + /** + * Returns information about the particular transfer run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TransferRun]{@link google.cloud.bigquery.datatransfer.v1.TransferRun}. + * 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/data_transfer_service.get_transfer_run.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_GetTransferRun_async + */ + getTransferRun( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | undefined + ), + {} | undefined + ] + >; + getTransferRun( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTransferRun( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTransferRun( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | 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.getTransferRun(request, options, callback); + } + /** + * Deletes the specified transfer run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.delete_transfer_run.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferRun_async + */ + deleteTransferRun( + request?: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | undefined + ), + {} | undefined + ] + >; + deleteTransferRun( + request: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTransferRun( + request: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTransferRun( + request?: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | 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.deleteTransferRun(request, options, callback); + } + /** + * Returns true if valid credentials exist for the given data source and + * requesting user. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CheckValidCredsResponse]{@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse}. + * 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/data_transfer_service.check_valid_creds.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_CheckValidCreds_async + */ + checkValidCreds( + request?: protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | undefined + ), + {} | undefined + ] + >; + checkValidCreds( + request: protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkValidCreds( + request: protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkValidCreds( + request?: protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | 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.checkValidCreds(request, options, callback); + } + /** + * Enroll data sources in a user project. This allows users to create transfer + * configurations for these data sources. They will also appear in the + * ListDataSources RPC and as such, will appear in the BigQuery UI + * 'https://bigquery.cloud.google.com' (and the documents can be found at + * https://cloud.google.com/bigquery/bigquery-web-ui and + * https://cloud.google.com/bigquery/docs/working-with-transfers). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name of the project resource in the form: + * `projects/{project_id}` + * @param {string[]} request.dataSourceIds + * Data sources that are enrolled. It is required to provide at least one + * data source id. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.enroll_data_sources.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_EnrollDataSources_async + */ + enrollDataSources( + request?: protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | undefined + ), + {} | undefined + ] + >; + enrollDataSources( + request: protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + enrollDataSources( + request: protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + enrollDataSources( + request?: protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | 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.enrollDataSources(request, options, callback); + } + + /** + * Lists supported data sources and returns their settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id} + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 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 [DataSource]{@link google.cloud.bigquery.datatransfer.v1.DataSource}. + * 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 `listDataSourcesAsync()` + * 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. + */ + listDataSources( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IDataSource[], + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + ] + >; + listDataSources( + request: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.IDataSource + > + ): void; + listDataSources( + request: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.IDataSource + > + ): void; + listDataSources( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.IDataSource + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.IDataSource + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IDataSource[], + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + ] + > | 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.listDataSources(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 BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id} + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 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 [DataSource]{@link google.cloud.bigquery.datatransfer.v1.DataSource} 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 `listDataSourcesAsync()` + * 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. + */ + listDataSourcesStream( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + 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['listDataSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataSources.createStream( + this.innerApiCalls.listDataSources as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDataSources`, 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 BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id} + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 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 + * [DataSource]{@link google.cloud.bigquery.datatransfer.v1.DataSource}. 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/data_transfer_service.list_data_sources.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_ListDataSources_async + */ + listDataSourcesAsync( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + 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['listDataSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataSources.asyncIterate( + this.innerApiCalls['listDataSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns information about all transfer configs owned by a project in the + * specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The BigQuery project id for which data sources + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * @param {string[]} request.dataSourceIds + * When specified, only configurations of requested data sources are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 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 [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig}. + * 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 `listTransferConfigsAsync()` + * 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. + */ + listTransferConfigs( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + ] + >; + listTransferConfigs( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig + > + ): void; + listTransferConfigs( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig + > + ): void; + listTransferConfigs( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + ] + > | 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.listTransferConfigs(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 BigQuery project id for which data sources + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * @param {string[]} request.dataSourceIds + * When specified, only configurations of requested data sources are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 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 [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig} 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 `listTransferConfigsAsync()` + * 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. + */ + listTransferConfigsStream( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + 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['listTransferConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferConfigs.createStream( + this.innerApiCalls.listTransferConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTransferConfigs`, 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 BigQuery project id for which data sources + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * @param {string[]} request.dataSourceIds + * When specified, only configurations of requested data sources are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 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 + * [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig}. 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/data_transfer_service.list_transfer_configs.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_ListTransferConfigs_async + */ + listTransferConfigsAsync( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + 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['listTransferConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferConfigs.asyncIterate( + this.innerApiCalls['listTransferConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns information about running and completed transfer runs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @param {number[]} request.states + * When specified, only transfer runs with requested states are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt} request.runAttempt + * Indicates how run attempts are to be pulled. + * @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 [TransferRun]{@link google.cloud.bigquery.datatransfer.v1.TransferRun}. + * 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 `listTransferRunsAsync()` + * 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. + */ + listTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + ] + >; + listTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun + > + ): void; + listTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun + > + ): void; + listTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + ] + > | 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.listTransferRuns(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @param {number[]} request.states + * When specified, only transfer runs with requested states are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt} request.runAttempt + * Indicates how run attempts are to be pulled. + * @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 [TransferRun]{@link google.cloud.bigquery.datatransfer.v1.TransferRun} 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 `listTransferRunsAsync()` + * 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. + */ + listTransferRunsStream( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + 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['listTransferRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferRuns.createStream( + this.innerApiCalls.listTransferRuns as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTransferRuns`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @param {number[]} request.states + * When specified, only transfer runs with requested states are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt} request.runAttempt + * Indicates how run attempts are to be pulled. + * @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 + * [TransferRun]{@link google.cloud.bigquery.datatransfer.v1.TransferRun}. 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/data_transfer_service.list_transfer_runs.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_ListTransferRuns_async + */ + listTransferRunsAsync( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + 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['listTransferRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferRuns.asyncIterate( + this.innerApiCalls['listTransferRuns'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns log messages for the transfer run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {number[]} request.messageTypes + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [TransferMessage]{@link google.cloud.bigquery.datatransfer.v1.TransferMessage}. + * 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 `listTransferLogsAsync()` + * 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. + */ + listTransferLogs( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + ] + >; + listTransferLogs( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage + > + ): void; + listTransferLogs( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage + > + ): void; + listTransferLogs( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + ] + > | 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.listTransferLogs(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. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {number[]} request.messageTypes + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [TransferMessage]{@link google.cloud.bigquery.datatransfer.v1.TransferMessage} 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 `listTransferLogsAsync()` + * 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. + */ + listTransferLogsStream( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + 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['listTransferLogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferLogs.createStream( + this.innerApiCalls.listTransferLogs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTransferLogs`, 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. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {number[]} request.messageTypes + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TransferMessage]{@link google.cloud.bigquery.datatransfer.v1.TransferMessage}. 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/data_transfer_service.list_transfer_logs.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_ListTransferLogs_async + */ + listTransferLogsAsync( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + 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['listTransferLogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferLogs.asyncIterate( + this.innerApiCalls['listTransferLogs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectDataSource resource name string. + * + * @param {string} project + * @param {string} data_source + * @returns {string} Resource name string. + */ + projectDataSourcePath(project: string, dataSource: string) { + return this.pathTemplates.projectDataSourcePathTemplate.render({ + project: project, + data_source: dataSource, + }); + } + + /** + * Parse the project from ProjectDataSource resource. + * + * @param {string} projectDataSourceName + * A fully-qualified path representing project_data_source resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectDataSourceName(projectDataSourceName: string) { + return this.pathTemplates.projectDataSourcePathTemplate.match( + projectDataSourceName + ).project; + } + + /** + * Parse the data_source from ProjectDataSource resource. + * + * @param {string} projectDataSourceName + * A fully-qualified path representing project_data_source resource. + * @returns {string} A string representing the data_source. + */ + matchDataSourceFromProjectDataSourceName(projectDataSourceName: string) { + return this.pathTemplates.projectDataSourcePathTemplate.match( + projectDataSourceName + ).data_source; + } + + /** + * Return a fully-qualified projectLocationDataSource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_source + * @returns {string} Resource name string. + */ + projectLocationDataSourcePath( + project: string, + location: string, + dataSource: string + ) { + return this.pathTemplates.projectLocationDataSourcePathTemplate.render({ + project: project, + location: location, + data_source: dataSource, + }); + } + + /** + * Parse the project from ProjectLocationDataSource resource. + * + * @param {string} projectLocationDataSourceName + * A fully-qualified path representing project_location_data_source resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataSourceName( + projectLocationDataSourceName: string + ) { + return this.pathTemplates.projectLocationDataSourcePathTemplate.match( + projectLocationDataSourceName + ).project; + } + + /** + * Parse the location from ProjectLocationDataSource resource. + * + * @param {string} projectLocationDataSourceName + * A fully-qualified path representing project_location_data_source resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataSourceName( + projectLocationDataSourceName: string + ) { + return this.pathTemplates.projectLocationDataSourcePathTemplate.match( + projectLocationDataSourceName + ).location; + } + + /** + * Parse the data_source from ProjectLocationDataSource resource. + * + * @param {string} projectLocationDataSourceName + * A fully-qualified path representing project_location_data_source resource. + * @returns {string} A string representing the data_source. + */ + matchDataSourceFromProjectLocationDataSourceName( + projectLocationDataSourceName: string + ) { + return this.pathTemplates.projectLocationDataSourcePathTemplate.match( + projectLocationDataSourceName + ).data_source; + } + + /** + * Return a fully-qualified projectLocationTransferConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} transfer_config + * @returns {string} Resource name string. + */ + projectLocationTransferConfigPath( + project: string, + location: string, + transferConfig: string + ) { + return this.pathTemplates.projectLocationTransferConfigPathTemplate.render({ + project: project, + location: location, + transfer_config: transferConfig, + }); + } + + /** + * Parse the project from ProjectLocationTransferConfig resource. + * + * @param {string} projectLocationTransferConfigName + * A fully-qualified path representing project_location_transfer_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationTransferConfigName( + projectLocationTransferConfigName: string + ) { + return this.pathTemplates.projectLocationTransferConfigPathTemplate.match( + projectLocationTransferConfigName + ).project; + } + + /** + * Parse the location from ProjectLocationTransferConfig resource. + * + * @param {string} projectLocationTransferConfigName + * A fully-qualified path representing project_location_transfer_config resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationTransferConfigName( + projectLocationTransferConfigName: string + ) { + return this.pathTemplates.projectLocationTransferConfigPathTemplate.match( + projectLocationTransferConfigName + ).location; + } + + /** + * Parse the transfer_config from ProjectLocationTransferConfig resource. + * + * @param {string} projectLocationTransferConfigName + * A fully-qualified path representing project_location_transfer_config resource. + * @returns {string} A string representing the transfer_config. + */ + matchTransferConfigFromProjectLocationTransferConfigName( + projectLocationTransferConfigName: string + ) { + return this.pathTemplates.projectLocationTransferConfigPathTemplate.match( + projectLocationTransferConfigName + ).transfer_config; + } + + /** + * Return a fully-qualified projectLocationTransferConfigRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} transfer_config + * @param {string} run + * @returns {string} Resource name string. + */ + projectLocationTransferConfigRunPath( + project: string, + location: string, + transferConfig: string, + run: string + ) { + return this.pathTemplates.projectLocationTransferConfigRunPathTemplate.render( + { + project: project, + location: location, + transfer_config: transferConfig, + run: run, + } + ); + } + + /** + * Parse the project from ProjectLocationTransferConfigRun resource. + * + * @param {string} projectLocationTransferConfigRunName + * A fully-qualified path representing project_location_transfer_config_run resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationTransferConfigRunName( + projectLocationTransferConfigRunName: string + ) { + return this.pathTemplates.projectLocationTransferConfigRunPathTemplate.match( + projectLocationTransferConfigRunName + ).project; + } + + /** + * Parse the location from ProjectLocationTransferConfigRun resource. + * + * @param {string} projectLocationTransferConfigRunName + * A fully-qualified path representing project_location_transfer_config_run resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationTransferConfigRunName( + projectLocationTransferConfigRunName: string + ) { + return this.pathTemplates.projectLocationTransferConfigRunPathTemplate.match( + projectLocationTransferConfigRunName + ).location; + } + + /** + * Parse the transfer_config from ProjectLocationTransferConfigRun resource. + * + * @param {string} projectLocationTransferConfigRunName + * A fully-qualified path representing project_location_transfer_config_run resource. + * @returns {string} A string representing the transfer_config. + */ + matchTransferConfigFromProjectLocationTransferConfigRunName( + projectLocationTransferConfigRunName: string + ) { + return this.pathTemplates.projectLocationTransferConfigRunPathTemplate.match( + projectLocationTransferConfigRunName + ).transfer_config; + } + + /** + * Parse the run from ProjectLocationTransferConfigRun resource. + * + * @param {string} projectLocationTransferConfigRunName + * A fully-qualified path representing project_location_transfer_config_run resource. + * @returns {string} A string representing the run. + */ + matchRunFromProjectLocationTransferConfigRunName( + projectLocationTransferConfigRunName: string + ) { + return this.pathTemplates.projectLocationTransferConfigRunPathTemplate.match( + projectLocationTransferConfigRunName + ).run; + } + + /** + * Return a fully-qualified projectTransferConfig resource name string. + * + * @param {string} project + * @param {string} transfer_config + * @returns {string} Resource name string. + */ + projectTransferConfigPath(project: string, transferConfig: string) { + return this.pathTemplates.projectTransferConfigPathTemplate.render({ + project: project, + transfer_config: transferConfig, + }); + } + + /** + * Parse the project from ProjectTransferConfig resource. + * + * @param {string} projectTransferConfigName + * A fully-qualified path representing project_transfer_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTransferConfigName(projectTransferConfigName: string) { + return this.pathTemplates.projectTransferConfigPathTemplate.match( + projectTransferConfigName + ).project; + } + + /** + * Parse the transfer_config from ProjectTransferConfig resource. + * + * @param {string} projectTransferConfigName + * A fully-qualified path representing project_transfer_config resource. + * @returns {string} A string representing the transfer_config. + */ + matchTransferConfigFromProjectTransferConfigName( + projectTransferConfigName: string + ) { + return this.pathTemplates.projectTransferConfigPathTemplate.match( + projectTransferConfigName + ).transfer_config; + } + + /** + * Return a fully-qualified projectTransferConfigRun resource name string. + * + * @param {string} project + * @param {string} transfer_config + * @param {string} run + * @returns {string} Resource name string. + */ + projectTransferConfigRunPath( + project: string, + transferConfig: string, + run: string + ) { + return this.pathTemplates.projectTransferConfigRunPathTemplate.render({ + project: project, + transfer_config: transferConfig, + run: run, + }); + } + + /** + * Parse the project from ProjectTransferConfigRun resource. + * + * @param {string} projectTransferConfigRunName + * A fully-qualified path representing project_transfer_config_run resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTransferConfigRunName( + projectTransferConfigRunName: string + ) { + return this.pathTemplates.projectTransferConfigRunPathTemplate.match( + projectTransferConfigRunName + ).project; + } + + /** + * Parse the transfer_config from ProjectTransferConfigRun resource. + * + * @param {string} projectTransferConfigRunName + * A fully-qualified path representing project_transfer_config_run resource. + * @returns {string} A string representing the transfer_config. + */ + matchTransferConfigFromProjectTransferConfigRunName( + projectTransferConfigRunName: string + ) { + return this.pathTemplates.projectTransferConfigRunPathTemplate.match( + projectTransferConfigRunName + ).transfer_config; + } + + /** + * Parse the run from ProjectTransferConfigRun resource. + * + * @param {string} projectTransferConfigRunName + * A fully-qualified path representing project_transfer_config_run resource. + * @returns {string} A string representing the run. + */ + matchRunFromProjectTransferConfigRunName( + projectTransferConfigRunName: string + ) { + return this.pathTemplates.projectTransferConfigRunPathTemplate.match( + projectTransferConfigRunName + ).run; + } + + /** + * 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.dataTransferServiceStub && !this._terminated) { + return this.dataTransferServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client_config.json b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client_config.json new file mode 100644 index 00000000000..32271a38400 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client_config.json @@ -0,0 +1,99 @@ +{ + "interfaces": { + "google.cloud.bigquery.datatransfer.v1.DataTransferService": { + "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": { + "GetDataSource": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListDataSources": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateTransferConfig": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTransferConfig": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTransferConfig": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetTransferConfig": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTransferConfigs": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ScheduleTransferRuns": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartManualTransferRuns": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTransferRun": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteTransferRun": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTransferRuns": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTransferLogs": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CheckValidCreds": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "EnrollDataSources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_proto_list.json b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_proto_list.json new file mode 100644 index 00000000000..2fc32ccab2a --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto", + "../../protos/google/cloud/bigquery/datatransfer/v1/transfer.proto" +] diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/gapic_metadata.json b/packages/google-cloud-bigquery-datatransfer/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..85059e6c876 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/gapic_metadata.json @@ -0,0 +1,189 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.bigquery.datatransfer.v1", + "libraryPackage": "@google-cloud/bigquery-data-transfer", + "services": { + "DataTransferService": { + "clients": { + "grpc": { + "libraryClient": "DataTransferServiceClient", + "rpcs": { + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "CreateTransferConfig": { + "methods": [ + "createTransferConfig" + ] + }, + "UpdateTransferConfig": { + "methods": [ + "updateTransferConfig" + ] + }, + "DeleteTransferConfig": { + "methods": [ + "deleteTransferConfig" + ] + }, + "GetTransferConfig": { + "methods": [ + "getTransferConfig" + ] + }, + "ScheduleTransferRuns": { + "methods": [ + "scheduleTransferRuns" + ] + }, + "StartManualTransferRuns": { + "methods": [ + "startManualTransferRuns" + ] + }, + "GetTransferRun": { + "methods": [ + "getTransferRun" + ] + }, + "DeleteTransferRun": { + "methods": [ + "deleteTransferRun" + ] + }, + "CheckValidCreds": { + "methods": [ + "checkValidCreds" + ] + }, + "EnrollDataSources": { + "methods": [ + "enrollDataSources" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources", + "listDataSourcesStream", + "listDataSourcesAsync" + ] + }, + "ListTransferConfigs": { + "methods": [ + "listTransferConfigs", + "listTransferConfigsStream", + "listTransferConfigsAsync" + ] + }, + "ListTransferRuns": { + "methods": [ + "listTransferRuns", + "listTransferRunsStream", + "listTransferRunsAsync" + ] + }, + "ListTransferLogs": { + "methods": [ + "listTransferLogs", + "listTransferLogsStream", + "listTransferLogsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataTransferServiceClient", + "rpcs": { + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "CreateTransferConfig": { + "methods": [ + "createTransferConfig" + ] + }, + "UpdateTransferConfig": { + "methods": [ + "updateTransferConfig" + ] + }, + "DeleteTransferConfig": { + "methods": [ + "deleteTransferConfig" + ] + }, + "GetTransferConfig": { + "methods": [ + "getTransferConfig" + ] + }, + "ScheduleTransferRuns": { + "methods": [ + "scheduleTransferRuns" + ] + }, + "StartManualTransferRuns": { + "methods": [ + "startManualTransferRuns" + ] + }, + "GetTransferRun": { + "methods": [ + "getTransferRun" + ] + }, + "DeleteTransferRun": { + "methods": [ + "deleteTransferRun" + ] + }, + "CheckValidCreds": { + "methods": [ + "checkValidCreds" + ] + }, + "EnrollDataSources": { + "methods": [ + "enrollDataSources" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources", + "listDataSourcesStream", + "listDataSourcesAsync" + ] + }, + "ListTransferConfigs": { + "methods": [ + "listTransferConfigs", + "listTransferConfigsStream", + "listTransferConfigsAsync" + ] + }, + "ListTransferRuns": { + "methods": [ + "listTransferRuns", + "listTransferRunsStream", + "listTransferRunsAsync" + ] + }, + "ListTransferLogs": { + "methods": [ + "listTransferLogs", + "listTransferLogsStream", + "listTransferLogsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/index.ts b/packages/google-cloud-bigquery-datatransfer/src/v1/index.ts new file mode 100644 index 00000000000..025734f63e2 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/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 {DataTransferServiceClient} from './data_transfer_service_client'; diff --git a/packages/google-cloud-bigquery-datatransfer/system-test/.eslintrc.yml b/packages/google-cloud-bigquery-datatransfer/system-test/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/system-test/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..9afaca04e5c --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const datatransfer = require('@google-cloud/bigquery-data-transfer'); + +function main() { + const dataTransferServiceClient = + new datatransfer.DataTransferServiceClient(); +} + +main(); diff --git a/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..bcd32e2fe0b --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,34 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {DataTransferServiceClient} from '@google-cloud/bigquery-data-transfer'; + +// check that the client class type name can be used +function doStuffWithDataTransferServiceClient( + client: DataTransferServiceClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dataTransferServiceClient = new DataTransferServiceClient(); + doStuffWithDataTransferServiceClient(dataTransferServiceClient); +} + +main(); diff --git a/packages/google-cloud-bigquery-datatransfer/system-test/install.ts b/packages/google-cloud-bigquery-datatransfer/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-bigquery-datatransfer/test/gapic_data_transfer_service_v1.ts b/packages/google-cloud-bigquery-datatransfer/test/gapic_data_transfer_service_v1.ts new file mode 100644 index 00000000000..14bf3b8ce21 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/test/gapic_data_transfer_service_v1.ts @@ -0,0 +1,3693 @@ +// 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 datatransferserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.DataTransferServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + datatransferserviceModule.v1.DataTransferServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + datatransferserviceModule.v1.DataTransferServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datatransferserviceModule.v1.DataTransferServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new datatransferserviceModule.v1.DataTransferServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.dataTransferServiceStub, undefined); + await client.initialize(); + assert(client.dataTransferServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.dataTransferServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.dataTransferServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + 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 datatransferserviceModule.v1.DataTransferServiceClient( + { + 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('getDataSource', () => { + it('invokes getDataSource without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ); + client.innerApiCalls.getDataSource = stubSimpleCall(expectedResponse); + const [response] = await client.getDataSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSource without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ); + client.innerApiCalls.getDataSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.IDataSource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSource with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataSource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDataSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSource with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataSource(request), expectedError); + }); + }); + + describe('createTransferConfig', () => { + it('invokes createTransferConfig without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.createTransferConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.createTransferConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransferConfig without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.createTransferConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTransferConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransferConfig with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTransferConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createTransferConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransferConfig with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTransferConfig(request), expectedError); + }); + }); + + describe('updateTransferConfig', () => { + it('invokes updateTransferConfig without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest() + ); + request.transferConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest', + ['transferConfig', 'name'] + ); + request.transferConfig.name = defaultValue1; + const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.updateTransferConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateTransferConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransferConfig without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest() + ); + request.transferConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest', + ['transferConfig', 'name'] + ); + request.transferConfig.name = defaultValue1; + const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.updateTransferConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTransferConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransferConfig with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest() + ); + request.transferConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest', + ['transferConfig', 'name'] + ); + request.transferConfig.name = defaultValue1; + const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTransferConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTransferConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransferConfig with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest() + ); + request.transferConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest', + ['transferConfig', 'name'] + ); + request.transferConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTransferConfig(request), expectedError); + }); + }); + + describe('deleteTransferConfig', () => { + it('invokes deleteTransferConfig without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTransferConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteTransferConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferConfig without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTransferConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTransferConfig( + 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.deleteTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferConfig with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTransferConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTransferConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferConfig with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTransferConfig(request), expectedError); + }); + }); + + describe('getTransferConfig', () => { + it('invokes getTransferConfig without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.getTransferConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getTransferConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferConfig without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.getTransferConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTransferConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferConfig with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTransferConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTransferConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferConfig with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTransferConfig(request), expectedError); + }); + }); + + describe('scheduleTransferRuns', () => { + it('invokes scheduleTransferRuns without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse() + ); + client.innerApiCalls.scheduleTransferRuns = + stubSimpleCall(expectedResponse); + const [response] = await client.scheduleTransferRuns(request); + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes scheduleTransferRuns without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse() + ); + client.innerApiCalls.scheduleTransferRuns = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.scheduleTransferRuns( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes scheduleTransferRuns with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.scheduleTransferRuns = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.scheduleTransferRuns(request), expectedError); + assert(stub.calledOnce); + const actualRequest = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes scheduleTransferRuns with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.scheduleTransferRuns(request), expectedError); + assert(stub.calledOnce); + }); + }); + + describe('startManualTransferRuns', () => { + it('invokes startManualTransferRuns without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse() + ); + client.innerApiCalls.startManualTransferRuns = + stubSimpleCall(expectedResponse); + const [response] = await client.startManualTransferRuns(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startManualTransferRuns without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse() + ); + client.innerApiCalls.startManualTransferRuns = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startManualTransferRuns( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startManualTransferRuns with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startManualTransferRuns = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.startManualTransferRuns(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startManualTransferRuns with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.startManualTransferRuns(request), + expectedError + ); + }); + }); + + describe('getTransferRun', () => { + it('invokes getTransferRun without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ); + client.innerApiCalls.getTransferRun = stubSimpleCall(expectedResponse); + const [response] = await client.getTransferRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferRun without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ); + client.innerApiCalls.getTransferRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTransferRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.ITransferRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferRun with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTransferRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTransferRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferRun with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTransferRun(request), expectedError); + }); + }); + + describe('deleteTransferRun', () => { + it('invokes deleteTransferRun without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTransferRun = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTransferRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferRun without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTransferRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTransferRun( + 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.deleteTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferRun with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTransferRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTransferRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferRun with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTransferRun(request), expectedError); + }); + }); + + describe('checkValidCreds', () => { + it('invokes checkValidCreds without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse() + ); + client.innerApiCalls.checkValidCreds = stubSimpleCall(expectedResponse); + const [response] = await client.checkValidCreds(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkValidCreds without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse() + ); + client.innerApiCalls.checkValidCreds = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkValidCreds( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkValidCreds with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkValidCreds = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkValidCreds(request), expectedError); + const actualRequest = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkValidCreds with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.checkValidCreds(request), expectedError); + }); + }); + + describe('enrollDataSources', () => { + it('invokes enrollDataSources without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.enrollDataSources = stubSimpleCall(expectedResponse); + const [response] = await client.enrollDataSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enrollDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enrollDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enrollDataSources without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.enrollDataSources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enrollDataSources( + 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.enrollDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enrollDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enrollDataSources with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enrollDataSources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.enrollDataSources(request), expectedError); + const actualRequest = ( + client.innerApiCalls.enrollDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enrollDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enrollDataSources with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.enrollDataSources(request), expectedError); + }); + }); + + describe('listDataSources', () => { + it('invokes listDataSources without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + ]; + client.innerApiCalls.listDataSources = stubSimpleCall(expectedResponse); + const [response] = await client.listDataSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSources without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + ]; + client.innerApiCalls.listDataSources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataSources( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.datatransfer.v1.IDataSource[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSources with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataSources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDataSources(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSourcesStream without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + ]; + client.descriptors.page.listDataSources.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDataSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.DataSource[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.DataSource + ) => { + 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.listDataSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataSources, request) + ); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDataSourcesStream with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSources.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.DataSource[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.DataSource + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataSources, request) + ); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataSources without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + ]; + client.descriptors.page.listDataSources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.datatransfer.v1.IDataSource[] = + []; + const iterable = client.listDataSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataSources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataSources with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSources.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataSourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.IDataSource[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataSources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTransferConfigs', () => { + it('invokes listTransferConfigs without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + ]; + client.innerApiCalls.listTransferConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listTransferConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferConfigs without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + ]; + client.innerApiCalls.listTransferConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransferConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferConfigs with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTransferConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTransferConfigs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferConfigsStream without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + ]; + client.descriptors.page.listTransferConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTransferConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferConfig + ) => { + 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.listTransferConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferConfigs, request) + ); + assert( + (client.descriptors.page.listTransferConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTransferConfigsStream with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransferConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTransferConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferConfigs, request) + ); + assert( + (client.descriptors.page.listTransferConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferConfigs without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + ]; + client.descriptors.page.listTransferConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig[] = + []; + const iterable = client.listTransferConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferConfigs with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransferConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTransferRuns', () => { + it('invokes listTransferRuns without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + ]; + client.innerApiCalls.listTransferRuns = stubSimpleCall(expectedResponse); + const [response] = await client.listTransferRuns(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferRuns without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + ]; + client.innerApiCalls.listTransferRuns = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransferRuns( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.datatransfer.v1.ITransferRun[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferRuns with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTransferRuns = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTransferRuns(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferRunsStream without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + ]; + client.descriptors.page.listTransferRuns.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTransferRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferRun[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferRun + ) => { + 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.listTransferRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferRuns, request) + ); + assert( + (client.descriptors.page.listTransferRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTransferRunsStream with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferRuns.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransferRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferRun[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferRun + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTransferRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferRuns, request) + ); + assert( + (client.descriptors.page.listTransferRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferRuns without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + ]; + client.descriptors.page.listTransferRuns.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferRun[] = + []; + const iterable = client.listTransferRunsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferRuns.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferRuns with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferRuns.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransferRunsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferRun[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferRuns.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTransferLogs', () => { + it('invokes listTransferLogs without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + ]; + client.innerApiCalls.listTransferLogs = stubSimpleCall(expectedResponse); + const [response] = await client.listTransferLogs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferLogs without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + ]; + client.innerApiCalls.listTransferLogs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransferLogs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferLogs with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTransferLogs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTransferLogs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferLogsStream without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + ]; + client.descriptors.page.listTransferLogs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTransferLogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferMessage[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferMessage + ) => { + 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.listTransferLogs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferLogs, request) + ); + assert( + (client.descriptors.page.listTransferLogs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTransferLogsStream with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferLogs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransferLogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferMessage[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferMessage + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTransferLogs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferLogs, request) + ); + assert( + (client.descriptors.page.listTransferLogs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferLogs without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + ]; + client.descriptors.page.listTransferLogs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage[] = + []; + const iterable = client.listTransferLogsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferLogs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferLogs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferLogs with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferLogs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransferLogsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferLogs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferLogs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + 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('projectDataSource', () => { + const fakePath = '/rendered/path/projectDataSource'; + const expectedParameters = { + project: 'projectValue', + data_source: 'dataSourceValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectDataSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectDataSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectDataSourcePath', () => { + const result = client.projectDataSourcePath( + 'projectValue', + 'dataSourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectDataSourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectDataSourceName', () => { + const result = client.matchProjectFromProjectDataSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectDataSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataSourceFromProjectDataSourceName', () => { + const result = + client.matchDataSourceFromProjectDataSourceName(fakePath); + assert.strictEqual(result, 'dataSourceValue'); + assert( + ( + client.pathTemplates.projectDataSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataSource', () => { + const fakePath = '/rendered/path/projectLocationDataSource'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_source: 'dataSourceValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationDataSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationDataSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationDataSourcePath', () => { + const result = client.projectLocationDataSourcePath( + 'projectValue', + 'locationValue', + 'dataSourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataSourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataSourceName', () => { + const result = + client.matchProjectFromProjectLocationDataSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataSourceName', () => { + const result = + client.matchLocationFromProjectLocationDataSourceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataSourceFromProjectLocationDataSourceName', () => { + const result = + client.matchDataSourceFromProjectLocationDataSourceName(fakePath); + assert.strictEqual(result, 'dataSourceValue'); + assert( + ( + client.pathTemplates.projectLocationDataSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationTransferConfig', () => { + const fakePath = '/rendered/path/projectLocationTransferConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + transfer_config: 'transferConfigValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationTransferConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationTransferConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationTransferConfigPath', () => { + const result = client.projectLocationTransferConfigPath( + 'projectValue', + 'locationValue', + 'transferConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationTransferConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationTransferConfigName', () => { + const result = + client.matchProjectFromProjectLocationTransferConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationTransferConfigName', () => { + const result = + client.matchLocationFromProjectLocationTransferConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTransferConfigFromProjectLocationTransferConfigName', () => { + const result = + client.matchTransferConfigFromProjectLocationTransferConfigName( + fakePath + ); + assert.strictEqual(result, 'transferConfigValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationTransferConfigRun', () => { + const fakePath = '/rendered/path/projectLocationTransferConfigRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + transfer_config: 'transferConfigValue', + run: 'runValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationTransferConfigRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationTransferConfigRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationTransferConfigRunPath', () => { + const result = client.projectLocationTransferConfigRunPath( + 'projectValue', + 'locationValue', + 'transferConfigValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationTransferConfigRunPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationTransferConfigRunName', () => { + const result = + client.matchProjectFromProjectLocationTransferConfigRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationTransferConfigRunName', () => { + const result = + client.matchLocationFromProjectLocationTransferConfigRunName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTransferConfigFromProjectLocationTransferConfigRunName', () => { + const result = + client.matchTransferConfigFromProjectLocationTransferConfigRunName( + fakePath + ); + assert.strictEqual(result, 'transferConfigValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromProjectLocationTransferConfigRunName', () => { + const result = + client.matchRunFromProjectLocationTransferConfigRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTransferConfig', () => { + const fakePath = '/rendered/path/projectTransferConfig'; + const expectedParameters = { + project: 'projectValue', + transfer_config: 'transferConfigValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectTransferConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTransferConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTransferConfigPath', () => { + const result = client.projectTransferConfigPath( + 'projectValue', + 'transferConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTransferConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTransferConfigName', () => { + const result = + client.matchProjectFromProjectTransferConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectTransferConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTransferConfigFromProjectTransferConfigName', () => { + const result = + client.matchTransferConfigFromProjectTransferConfigName(fakePath); + assert.strictEqual(result, 'transferConfigValue'); + assert( + ( + client.pathTemplates.projectTransferConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTransferConfigRun', () => { + const fakePath = '/rendered/path/projectTransferConfigRun'; + const expectedParameters = { + project: 'projectValue', + transfer_config: 'transferConfigValue', + run: 'runValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectTransferConfigRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTransferConfigRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTransferConfigRunPath', () => { + const result = client.projectTransferConfigRunPath( + 'projectValue', + 'transferConfigValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTransferConfigRunPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTransferConfigRunName', () => { + const result = + client.matchProjectFromProjectTransferConfigRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTransferConfigFromProjectTransferConfigRunName', () => { + const result = + client.matchTransferConfigFromProjectTransferConfigRunName(fakePath); + assert.strictEqual(result, 'transferConfigValue'); + assert( + ( + client.pathTemplates.projectTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromProjectTransferConfigRunName', () => { + const result = + client.matchRunFromProjectTransferConfigRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.projectTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-datatransfer/tsconfig.json b/packages/google-cloud-bigquery-datatransfer/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-bigquery-datatransfer/webpack.config.js b/packages/google-cloud-bigquery-datatransfer/webpack.config.js new file mode 100644 index 00000000000..a4ee6847ab3 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/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: 'DataTransferService', + filename: './data-transfer-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-config.json b/release-please-config.json index 6e44f27d6f2..1c5a0734a6a 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -9,6 +9,7 @@ "packages/google-cloud-beyondcorp-clientgateways": {}, "packages/google-cloud-bigquery-analyticshub": {}, "packages/google-cloud-bigquery-datapolicies": {}, + "packages/google-cloud-bigquery-datatransfer": {}, "packages/google-cloud-gkemulticloud": {}, "packages/google-cloud-language": {}, "packages/google-cloud-oslogin": {},