diff --git a/packages/google-storagetransfer/.eslintignore b/packages/google-storagetransfer/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-storagetransfer/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-storagetransfer/.eslintrc.json b/packages/google-storagetransfer/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-storagetransfer/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-storagetransfer/.gitattributes b/packages/google-storagetransfer/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-storagetransfer/.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-storagetransfer/.github/.OwlBot.yaml b/packages/google-storagetransfer/.github/.OwlBot.yaml new file mode 100644 index 00000000000..6abc144ad96 --- /dev/null +++ b/packages/google-storagetransfer/.github/.OwlBot.yaml @@ -0,0 +1,22 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/storagetransfer/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 diff --git a/packages/google-storagetransfer/.gitignore b/packages/google-storagetransfer/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-storagetransfer/.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-storagetransfer/.jsdoc.js b/packages/google-storagetransfer/.jsdoc.js new file mode 100644 index 00000000000..0ffbf58aca6 --- /dev/null +++ b/packages/google-storagetransfer/.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/storage-transfer', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-storagetransfer/.mocharc.js b/packages/google-storagetransfer/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-storagetransfer/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-storagetransfer/.nycrc b/packages/google-storagetransfer/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-storagetransfer/.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-storagetransfer/.prettierignore b/packages/google-storagetransfer/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-storagetransfer/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-storagetransfer/.prettierrc.js b/packages/google-storagetransfer/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-storagetransfer/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-storagetransfer/.repo-metadata.json b/packages/google-storagetransfer/.repo-metadata.json new file mode 100644 index 00000000000..bf72c8449f9 --- /dev/null +++ b/packages/google-storagetransfer/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "storagetransfer", + "name_pretty": "Storage Transfer Service", + "product_documentation": "https://cloud.google.com/storage-transfer/", + "client_documentation": "https://googleapis.dev/nodejs/storagetransfer/latest/index.html", + "issue_tracker": "https://github.com/googleapis/nodejs-storage-transfer/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/nodejs-storage-transfer", + "distribution_name": "@google-cloud/storage-transfer", + "api_id": "storagetransfer.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "api_shortname": "storagetransfer", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-storagetransfer/CHANGELOG.md b/packages/google-storagetransfer/CHANGELOG.md new file mode 100644 index 00000000000..cf4d354d278 --- /dev/null +++ b/packages/google-storagetransfer/CHANGELOG.md @@ -0,0 +1,100 @@ +# Changelog + +## [2.2.1](https://github.com/googleapis/nodejs-storage-transfer/compare/v2.2.0...v2.2.1) (2022-11-10) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#121](https://github.com/googleapis/nodejs-storage-transfer/issues/121)) ([ee66be0](https://github.com/googleapis/nodejs-storage-transfer/commit/ee66be0297f1665298912c641fa9f2e1b3c2a1a7)) +* Regenerated protos JS and TS definitions ([#125](https://github.com/googleapis/nodejs-storage-transfer/issues/125)) ([21ad9a7](https://github.com/googleapis/nodejs-storage-transfer/commit/21ad9a7190881ecdb8cf68fabcdc4fb42ffc626b)) + +## [2.2.0](https://github.com/googleapis/nodejs-storage-transfer/compare/v2.1.2...v2.2.0) (2022-09-23) + + +### Features + +* add AWS S3 compatible data source ([35ae4f8](https://github.com/googleapis/nodejs-storage-transfer/commit/35ae4f8ef13c1a71ced84b919542a79fe93fcd01)) +* add default retry configuration ([35ae4f8](https://github.com/googleapis/nodejs-storage-transfer/commit/35ae4f8ef13c1a71ced84b919542a79fe93fcd01)) +* add DeleteTransferJob operation ([35ae4f8](https://github.com/googleapis/nodejs-storage-transfer/commit/35ae4f8ef13c1a71ced84b919542a79fe93fcd01)) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#94](https://github.com/googleapis/nodejs-storage-transfer/issues/94)) ([35ae4f8](https://github.com/googleapis/nodejs-storage-transfer/commit/35ae4f8ef13c1a71ced84b919542a79fe93fcd01)) + +## [2.1.2](https://github.com/googleapis/nodejs-storage-transfer/compare/v2.1.1...v2.1.2) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#90](https://github.com/googleapis/nodejs-storage-transfer/issues/90)) ([4a3a152](https://github.com/googleapis/nodejs-storage-transfer/commit/4a3a15289dbb40d3aabc4f2e3b192f7e0f0bbc18)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-storage-transfer/issues/1553)) ([#89](https://github.com/googleapis/nodejs-storage-transfer/issues/89)) ([c6768fb](https://github.com/googleapis/nodejs-storage-transfer/commit/c6768fb0b61e87960b4bdf6a647017b4a4a93029)) + +## [2.1.1](https://github.com/googleapis/nodejs-storage-transfer/compare/v2.1.0...v2.1.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#83](https://github.com/googleapis/nodejs-storage-transfer/issues/83)) ([e5e44b9](https://github.com/googleapis/nodejs-storage-transfer/commit/e5e44b993b427afedc50be45670dfb76fd1ad3a4)) +* change import long to require ([#85](https://github.com/googleapis/nodejs-storage-transfer/issues/85)) ([7a95e0b](https://github.com/googleapis/nodejs-storage-transfer/commit/7a95e0b487ccbcc58f13019a90b7fb4f80b482fd)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-storage-transfer/issues/1546)) ([#88](https://github.com/googleapis/nodejs-storage-transfer/issues/88)) ([bf0cd79](https://github.com/googleapis/nodejs-storage-transfer/commit/bf0cd793f48d21e51fa70c043377e07f2604cbc1)) + +## [2.1.0](https://github.com/googleapis/nodejs-storage-transfer/compare/v2.0.0...v2.1.0) (2022-06-30) + + +### Features + +* **samples:** Add POSIX & Manifest samples ([#67](https://github.com/googleapis/nodejs-storage-transfer/issues/67)) ([1056c9f](https://github.com/googleapis/nodejs-storage-transfer/commit/1056c9fde90c0c7b79a235d4c9f5f861efce3169)) +* support regapic LRO ([#75](https://github.com/googleapis/nodejs-storage-transfer/issues/75)) ([cc80906](https://github.com/googleapis/nodejs-storage-transfer/commit/cc80906bcf86b68485fd62970b1b6f8a30c1123b)) + +## [2.0.0](https://github.com/googleapis/nodejs-storage-transfer/compare/v1.2.0...v2.0.0) (2022-05-31) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#64) + +### Build System + +* update library to use Node 12 ([#64](https://github.com/googleapis/nodejs-storage-transfer/issues/64)) ([908f83e](https://github.com/googleapis/nodejs-storage-transfer/commit/908f83e07c89cd14a434fe2a09f5ca22ef3956be)) + +## [1.2.0](https://github.com/googleapis/nodejs-storage-transfer/compare/v1.1.1...v1.2.0) (2022-04-06) + + +### Features + +* add support for Agent Pools ([#51](https://github.com/googleapis/nodejs-storage-transfer/issues/51)) ([0baf572](https://github.com/googleapis/nodejs-storage-transfer/commit/0baf5721ce0d8a49059ec75e3b57f63c0e381e36)) +* Increase STS Sample Coverage ([#42](https://github.com/googleapis/nodejs-storage-transfer/issues/42)) ([e10a3e4](https://github.com/googleapis/nodejs-storage-transfer/commit/e10a3e4fa5c712f9f857748eec98b7e0317460d9)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-storage-transfer/compare/v1.1.0...v1.1.1) (2021-09-10) + + +### Bug Fixes + +* **build:** set default branch to main ([#14](https://www.github.com/googleapis/nodejs-storage-transfer/issues/14)) ([9068b92](https://www.github.com/googleapis/nodejs-storage-transfer/commit/9068b9213daa48d4592ff51c0e520af6eb631b45)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-storage-transfer/compare/v1.0.1...v1.1.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#9](https://www.github.com/googleapis/nodejs-storage-transfer/issues/9)) ([47dde37](https://www.github.com/googleapis/nodejs-storage-transfer/commit/47dde3725b8907d1f974dca83b778ccd7e312bef)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-storage-transfer/compare/v1.0.0...v1.0.1) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#7](https://www.github.com/googleapis/nodejs-storage-transfer/issues/7)) ([e52a0be](https://www.github.com/googleapis/nodejs-storage-transfer/commit/e52a0befc6497c68ea5401e35f3c1c7de0402941)) + +## 1.0.0 (2021-08-03) + + +### ⚠ BREAKING CHANGES + +* initial generation of nodejs-storage-transfer library (#2) + +### Features + +* initial generation of nodejs-storage-transfer library ([#2](https://www.github.com/googleapis/nodejs-storage-transfer/issues/2)) ([1179aad](https://www.github.com/googleapis/nodejs-storage-transfer/commit/1179aadc343772b7b31406f1d884153a362f1c16)) +* initial stub of library ([f825ae3](https://www.github.com/googleapis/nodejs-storage-transfer/commit/f825ae32380ed31f4d64102a4554292f97aa1fc2)) diff --git a/packages/google-storagetransfer/CODE_OF_CONDUCT.md b/packages/google-storagetransfer/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-storagetransfer/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-storagetransfer/CONTRIBUTING.md b/packages/google-storagetransfer/CONTRIBUTING.md new file mode 100644 index 00000000000..233dcb2f437 --- /dev/null +++ b/packages/google-storagetransfer/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 Storage 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=storagetransfer.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-storagetransfer/LICENSE b/packages/google-storagetransfer/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-storagetransfer/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-storagetransfer/README.md b/packages/google-storagetransfer/README.md new file mode 100644 index 00000000000..c2bbc869658 --- /dev/null +++ b/packages/google-storagetransfer/README.md @@ -0,0 +1,204 @@ +[//]: # "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 + +# [Storage Transfer Service: Node.js Client](https://github.com/googleapis/nodejs-storage-transfer) + +[![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/storage-transfer.svg)](https://www.npmjs.org/package/@google-cloud/storage-transfer) + + + + +storagetransfer client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-storage-transfer/blob/main/CHANGELOG.md). + +* [Storage Transfer Service Node.js Client API Reference][client-docs] +* [Storage Transfer Service Documentation][product-docs] +* [github.com/googleapis/nodejs-storage-transfer](https://github.com/googleapis/nodejs-storage-transfer) + +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 Storage 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/storage-transfer +``` + + +### Using the client library + +```javascript + +// Imports the Google Cloud client library +const { + StorageTransferServiceClient, +} = require('@google-cloud/storage-transfer'); + +/** + * TODO(developer): Uncomment the following lines before running the sample. + */ +// Your project id +// const projectId = 'my-project' + +// The ID of the GCS bucket to transfer data from +// const gcsSourceBucket = 'my-source-bucket' + +// The ID of the GCS bucket to transfer data to +// const gcsSinkBucket = 'my-sink-bucket' + +// Creates a client +const client = new StorageTransferServiceClient(); + +/** + * Creates a one-time transfer job. + */ +async function quickstart() { + // Creates a request to transfer from the source bucket to + // the sink bucket + const createRequest = { + transferJob: { + projectId: projectId, + transferSpec: { + gcsDataSource: {bucketName: gcsSourceBucket}, + gcsDataSink: {bucketName: gcsSinkBucket}, + }, + status: 'ENABLED', + }, + }; + + // Runs the request and creates the job + const [transferJob] = await client.createTransferJob(createRequest); + + const runRequest = { + jobName: transferJob.name, + projectId: projectId, + }; + await client.runTransferJob(runRequest); + + console.log( + `Created and ran a transfer job from ${gcsSourceBucket} to ${gcsSinkBucket} with name ${transferJob.name}` + ); +} + +quickstart(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-storage-transfer/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Aws-request | [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/aws-request.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/aws-request.js,samples/README.md) | +| Aws-s3-compatible-source-request | [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/aws-s3-compatible-source-request.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/aws-s3-compatible-source-request.js,samples/README.md) | +| Check-latest-transfer-operation | [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/check-latest-transfer-operation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/check-latest-transfer-operation.js,samples/README.md) | +| Get-transfer-job-with-retries | [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/get-transfer-job-with-retries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/get-transfer-job-with-retries.js,samples/README.md) | +| Manifest-request | [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/manifest-request.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/manifest-request.js,samples/README.md) | +| Nearline-request | [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/nearline-request.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/nearline-request.js,samples/README.md) | +| Posix-download | [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/posix-download.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/posix-download.js,samples/README.md) | +| Posix-request | [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/posix-request.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/posix-request.js,samples/README.md) | +| Posix-to-posix-request | [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/posix-to-posix-request.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/posix-to-posix-request.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Transfer-check | [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/transfer-check.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/transfer-check.js,samples/README.md) | + + + +The [Storage 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/storage-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/nodejs-storage-transfer/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-storage-transfer/blob/main/LICENSE) + +[client-docs]: https://googleapis.dev/nodejs/storagetransfer/latest/index.html +[product-docs]: https://cloud.google.com/storage-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=storagetransfer.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-storagetransfer/linkinator.config.json b/packages/google-storagetransfer/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-storagetransfer/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-storagetransfer/package.json b/packages/google-storagetransfer/package.json new file mode 100644 index 00000000000..30330fb5605 --- /dev/null +++ b/packages/google-storagetransfer/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/storage-transfer", + "version": "2.2.1", + "description": "storagetransfer client for Node.js", + "repository": "googleapis/nodejs-storage-transfer", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google storagetransfer", + "storagetransfer", + "storagetransfer service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.6.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-storagetransfer/protos/google/storagetransfer/v1/transfer.proto b/packages/google-storagetransfer/protos/google/storagetransfer/v1/transfer.proto new file mode 100644 index 00000000000..802cc104613 --- /dev/null +++ b/packages/google-storagetransfer/protos/google/storagetransfer/v1/transfer.proto @@ -0,0 +1,387 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.storagetransfer.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/storagetransfer/v1/transfer_types.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.StorageTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/storagetransfer/v1;storagetransfer"; +option java_outer_classname = "TransferProto"; +option java_package = "com.google.storagetransfer.v1.proto"; +option php_namespace = "Google\\Cloud\\StorageTransfer\\V1"; +option ruby_package = "Google::Cloud::StorageTransfer::V1"; + +// Storage Transfer Service and its protos. +// Transfers data between between Google Cloud Storage buckets or from a data +// source external to Google to a Cloud Storage bucket. +service StorageTransferService { + option (google.api.default_host) = "storagetransfer.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns the Google service account that is used by Storage Transfer + // Service to access buckets in the project where transfers + // run or in other projects. Each Google service account is associated + // with one Google Cloud project. Users + // should add this service account to the Google Cloud Storage bucket + // ACLs to grant access to Storage Transfer Service. This service + // account is created and owned by Storage Transfer Service and can + // only be used by Storage Transfer Service. + rpc GetGoogleServiceAccount(GetGoogleServiceAccountRequest) returns (GoogleServiceAccount) { + option (google.api.http) = { + get: "/v1/googleServiceAccounts/{project_id}" + }; + } + + // Creates a transfer job that runs periodically. + rpc CreateTransferJob(CreateTransferJobRequest) returns (TransferJob) { + option (google.api.http) = { + post: "/v1/transferJobs" + body: "transfer_job" + }; + } + + // Updates a transfer job. Updating a job's transfer spec does not affect + // transfer operations that are running already. + // + // **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified + // using this RPC (for example, to set a job's status to + // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], + // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or + // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]). + rpc UpdateTransferJob(UpdateTransferJobRequest) returns (TransferJob) { + option (google.api.http) = { + patch: "/v1/{job_name=transferJobs/**}" + body: "*" + }; + } + + // Gets a transfer job. + rpc GetTransferJob(GetTransferJobRequest) returns (TransferJob) { + option (google.api.http) = { + get: "/v1/{job_name=transferJobs/**}" + }; + } + + // Lists transfer jobs. + rpc ListTransferJobs(ListTransferJobsRequest) returns (ListTransferJobsResponse) { + option (google.api.http) = { + get: "/v1/transferJobs" + }; + } + + // Pauses a transfer operation. + rpc PauseTransferOperation(PauseTransferOperationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=transferOperations/**}:pause" + body: "*" + }; + } + + // Resumes a transfer operation that is paused. + rpc ResumeTransferOperation(ResumeTransferOperationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=transferOperations/**}:resume" + body: "*" + }; + } + + // Attempts to start a new TransferOperation for the current TransferJob. A + // TransferJob has a maximum of one active TransferOperation. If this method + // is called while a TransferOperation is active, an error will be returned. + rpc RunTransferJob(RunTransferJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{job_name=transferJobs/**}:run" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "TransferOperation" + }; + } + + // Deletes a transfer job. Deleting a transfer job sets its status to + // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED]. + rpc DeleteTransferJob(DeleteTransferJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{job_name=transferJobs/**}" + }; + } + + // Creates an agent pool resource. + rpc CreateAgentPool(CreateAgentPoolRequest) returns (AgentPool) { + option (google.api.http) = { + post: "/v1/projects/{project_id=*}/agentPools" + body: "agent_pool" + }; + option (google.api.method_signature) = "project_id,agent_pool,agent_pool_id"; + } + + // Updates an existing agent pool resource. + rpc UpdateAgentPool(UpdateAgentPoolRequest) returns (AgentPool) { + option (google.api.http) = { + patch: "/v1/{agent_pool.name=projects/*/agentPools/*}" + body: "agent_pool" + }; + option (google.api.method_signature) = "agent_pool,update_mask"; + } + + // Gets an agent pool. + rpc GetAgentPool(GetAgentPoolRequest) returns (AgentPool) { + option (google.api.http) = { + get: "/v1/{name=projects/*/agentPools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists agent pools. + rpc ListAgentPools(ListAgentPoolsRequest) returns (ListAgentPoolsResponse) { + option (google.api.http) = { + get: "/v1/projects/{project_id=*}/agentPools" + }; + option (google.api.method_signature) = "project_id"; + } + + // Deletes an agent pool. + rpc DeleteAgentPool(DeleteAgentPoolRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/agentPools/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request passed to GetGoogleServiceAccount. +message GetGoogleServiceAccountRequest { + // Required. The ID of the Google Cloud project that the Google service + // account is associated with. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request passed to CreateTransferJob. +message CreateTransferJobRequest { + // Required. The job to create. + TransferJob transfer_job = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request passed to UpdateTransferJob. +message UpdateTransferJobRequest { + // Required. The name of job to update. + string job_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the Google Cloud project that owns the + // job. + string project_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The job to update. `transferJob` is expected to specify one or more of + // five fields: [description][google.storagetransfer.v1.TransferJob.description], + // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec], + // [notification_config][google.storagetransfer.v1.TransferJob.notification_config], + // [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and + // [status][google.storagetransfer.v1.TransferJob.status]. An `UpdateTransferJobRequest` that specifies + // other fields are rejected with the error + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a job status + // to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires + // `storagetransfer.jobs.delete` permission. + TransferJob transfer_job = 3 [(google.api.field_behavior) = REQUIRED]; + + // The field mask of the fields in `transferJob` that are to be updated in + // this request. Fields in `transferJob` that can be updated are: + // [description][google.storagetransfer.v1.TransferJob.description], + // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec], + // [notification_config][google.storagetransfer.v1.TransferJob.notification_config], + // [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and + // [status][google.storagetransfer.v1.TransferJob.status]. To update the `transfer_spec` of the job, a + // complete transfer specification must be provided. An incomplete + // specification missing any required fields is rejected with the error + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + google.protobuf.FieldMask update_transfer_job_field_mask = 4; +} + +// Request passed to GetTransferJob. +message GetTransferJobRequest { + // Required. The job to get. + string job_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the Google Cloud project that owns the + // job. + string project_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request passed to DeleteTransferJob. +message DeleteTransferJobRequest { + // Required. The job to delete. + string job_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the Google Cloud project that owns the + // job. + string project_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `projectId`, `jobNames`, and `jobStatuses` are query parameters that can +// be specified when listing transfer jobs. +message ListTransferJobsRequest { + // Required. A list of query parameters specified as JSON text in the form of: + // `{"projectId":"my_project_id", + // "jobNames":["jobid1","jobid2",...], + // "jobStatuses":["status1","status2",...]}` + // + // Since `jobNames` and `jobStatuses` support multiple values, their values + // must be specified with array notation. `projectId` is required. + // `jobNames` and `jobStatuses` are optional. The valid values for + // `jobStatuses` are case-insensitive: + // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED], + // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and + // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED]. + string filter = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list page size. The max allowed value is 256. + int32 page_size = 4; + + // The list page token. + string page_token = 5; +} + +// Response from ListTransferJobs. +message ListTransferJobsResponse { + // A list of transfer jobs. + repeated TransferJob transfer_jobs = 1; + + // The list next page token. + string next_page_token = 2; +} + +// Request passed to PauseTransferOperation. +message PauseTransferOperationRequest { + // Required. The name of the transfer operation. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request passed to ResumeTransferOperation. +message ResumeTransferOperationRequest { + // Required. The name of the transfer operation. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request passed to RunTransferJob. +message RunTransferJobRequest { + // Required. The name of the transfer job. + string job_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the Google Cloud project that owns the transfer + // job. + string project_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the request passed to CreateAgentPool. +message CreateAgentPoolRequest { + // Required. The ID of the Google Cloud project that owns the + // agent pool. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The agent pool to create. + AgentPool agent_pool = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the agent pool to create. + // + // The `agent_pool_id` must meet the following requirements: + // + // * Length of 128 characters or less. + // * Not start with the string `goog`. + // * Start with a lowercase ASCII character, followed by: + // * Zero or more: lowercase Latin alphabet characters, numerals, + // hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). + // * One or more numerals or lowercase ASCII characters. + // + // As expressed by the regular expression: + // `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. + string agent_pool_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the request passed to UpdateAgentPool. +message UpdateAgentPoolRequest { + // Required. The agent pool to update. `agent_pool` is expected to specify following + // fields: + // + // * [name][google.storagetransfer.v1.AgentPool.name] + // + // * [display_name][google.storagetransfer.v1.AgentPool.display_name] + // + // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] + // An `UpdateAgentPoolRequest` with any other fields is rejected + // with the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + AgentPool agent_pool = 1 [(google.api.field_behavior) = REQUIRED]; + + // The [field mask] + // (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) + // of the fields in `agentPool` to update in this request. + // The following `agentPool` fields can be updated: + // + // * [display_name][google.storagetransfer.v1.AgentPool.display_name] + // + // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] + google.protobuf.FieldMask update_mask = 2; +} + +// Specifies the request passed to GetAgentPool. +message GetAgentPoolRequest { + // Required. The name of the agent pool to get. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the request passed to DeleteAgentPool. +message DeleteAgentPoolRequest { + // Required. The name of the agent pool to delete. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The request passed to ListAgentPools. +message ListAgentPoolsRequest { + // Required. The ID of the Google Cloud project that owns the job. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // An optional list of query parameters specified as JSON text in the + // form of: + // + // `{"agentPoolNames":["agentpool1","agentpool2",...]}` + // + // Since `agentPoolNames` support multiple values, its values must be + // specified with array notation. When the filter is either empty or not + // provided, the list returns all agent pools for the project. + string filter = 2; + + // The list page size. The max allowed value is `256`. + int32 page_size = 3; + + // The list page token. + string page_token = 4; +} + +// Response from ListAgentPools. +message ListAgentPoolsResponse { + // A list of agent pools. + repeated AgentPool agent_pools = 1; + + // The list next page token. + string next_page_token = 2; +} diff --git a/packages/google-storagetransfer/protos/google/storagetransfer/v1/transfer_types.proto b/packages/google-storagetransfer/protos/google/storagetransfer/v1/transfer_types.proto new file mode 100644 index 00000000000..4e1a3b5f208 --- /dev/null +++ b/packages/google-storagetransfer/protos/google/storagetransfer/v1/transfer_types.proto @@ -0,0 +1,1227 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.storagetransfer.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/code.proto"; +import "google/type/date.proto"; +import "google/type/timeofday.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.StorageTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/storagetransfer/v1;storagetransfer"; +option java_outer_classname = "TransferTypes"; +option java_package = "com.google.storagetransfer.v1.proto"; +option php_namespace = "Google\\Cloud\\StorageTransfer\\V1"; +option ruby_package = "Google::Cloud::StorageTransfer::V1"; + +// Google service account +message GoogleServiceAccount { + // Email address of the service account. + string account_email = 1; + + // Unique identifier for the service account. + string subject_id = 2; +} + +// AWS access key (see +// [AWS Security +// Credentials](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). +// +// For information on our data retention policy for user credentials, see +// [User credentials](/storage-transfer/docs/data-retention#user-credentials). +message AwsAccessKey { + // Required. AWS access key ID. + string access_key_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. AWS secret access key. This field is not returned in RPC + // responses. + string secret_access_key = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Azure credentials +// +// For information on our data retention policy for user credentials, see +// [User credentials](/storage-transfer/docs/data-retention#user-credentials). +message AzureCredentials { + // Required. Azure shared access signature (SAS). + // + // For more information about SAS, see + // [Grant limited access to Azure Storage resources using shared access + // signatures + // (SAS)](https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview). + string sas_token = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Conditions that determine which objects are transferred. Applies only +// to Cloud Data Sources such as S3, Azure, and Cloud Storage. +// +// The "last modification time" refers to the time of the +// last change to the object's content or metadata — specifically, this is +// the `updated` property of Cloud Storage objects, the `LastModified` field +// of S3 objects, and the `Last-Modified` header of Azure blobs. +// +// Transfers with a [PosixFilesystem][google.storagetransfer.v1.PosixFilesystem] source or destination don't support +// `ObjectConditions`. +message ObjectConditions { + // Ensures that objects are not transferred until a specific minimum time + // has elapsed after the "last modification time". When a + // [TransferOperation][google.storagetransfer.v1.TransferOperation] begins, objects with a "last modification time" are + // transferred only if the elapsed time between the + // [start_time][google.storagetransfer.v1.TransferOperation.start_time] of the `TransferOperation` + // and the "last modification time" of the object is equal to or + // greater than the value of min_time_elapsed_since_last_modification`. + // Objects that do not have a "last modification time" are also transferred. + google.protobuf.Duration min_time_elapsed_since_last_modification = 1; + + // Ensures that objects are not transferred if a specific maximum time + // has elapsed since the "last modification time". + // When a [TransferOperation][google.storagetransfer.v1.TransferOperation] begins, objects with a + // "last modification time" are transferred only if the elapsed time + // between the [start_time][google.storagetransfer.v1.TransferOperation.start_time] of the + // `TransferOperation`and the "last modification time" of the object + // is less than the value of max_time_elapsed_since_last_modification`. + // Objects that do not have a "last modification time" are also transferred. + google.protobuf.Duration max_time_elapsed_since_last_modification = 2; + + // If you specify `include_prefixes`, Storage Transfer Service uses the items + // in the `include_prefixes` array to determine which objects to include in a + // transfer. Objects must start with one of the matching `include_prefixes` + // for inclusion in the transfer. If [exclude_prefixes][google.storagetransfer.v1.ObjectConditions.exclude_prefixes] is specified, + // objects must not start with any of the `exclude_prefixes` specified for + // inclusion in the transfer. + // + // The following are requirements of `include_prefixes`: + // + // * Each include-prefix can contain any sequence of Unicode characters, to + // a max length of 1024 bytes when UTF8-encoded, and must not contain + // Carriage Return or Line Feed characters. Wildcard matching and regular + // expression matching are not supported. + // + // * Each include-prefix must omit the leading slash. For example, to + // include the object `s3://my-aws-bucket/logs/y=2015/requests.gz`, + // specify the include-prefix as `logs/y=2015/requests.gz`. + // + // * None of the include-prefix values can be empty, if specified. + // + // * Each include-prefix must include a distinct portion of the object + // namespace. No include-prefix may be a prefix of another + // include-prefix. + // + // The max size of `include_prefixes` is 1000. + // + // For more information, see [Filtering objects from + // transfers](/storage-transfer/docs/filtering-objects-from-transfers). + repeated string include_prefixes = 3; + + // If you specify `exclude_prefixes`, Storage Transfer Service uses the items + // in the `exclude_prefixes` array to determine which objects to exclude from + // a transfer. Objects must not start with one of the matching + // `exclude_prefixes` for inclusion in a transfer. + // + // The following are requirements of `exclude_prefixes`: + // + // * Each exclude-prefix can contain any sequence of Unicode characters, to + // a max length of 1024 bytes when UTF8-encoded, and must not contain + // Carriage Return or Line Feed characters. Wildcard matching and regular + // expression matching are not supported. + // + // * Each exclude-prefix must omit the leading slash. For example, to + // exclude the object `s3://my-aws-bucket/logs/y=2015/requests.gz`, + // specify the exclude-prefix as `logs/y=2015/requests.gz`. + // + // * None of the exclude-prefix values can be empty, if specified. + // + // * Each exclude-prefix must exclude a distinct portion of the object + // namespace. No exclude-prefix may be a prefix of another + // exclude-prefix. + // + // * If [include_prefixes][google.storagetransfer.v1.ObjectConditions.include_prefixes] is specified, then each exclude-prefix must + // start with the value of a path explicitly included by `include_prefixes`. + // + // The max size of `exclude_prefixes` is 1000. + // + // For more information, see [Filtering objects from + // transfers](/storage-transfer/docs/filtering-objects-from-transfers). + repeated string exclude_prefixes = 4; + + // If specified, only objects with a "last modification time" on or after + // this timestamp and objects that don't have a "last modification time" are + // transferred. + // + // The `last_modified_since` and `last_modified_before` fields can be used + // together for chunked data processing. For example, consider a script that + // processes each day's worth of data at a time. For that you'd set each + // of the fields as follows: + // + // * `last_modified_since` to the start of the day + // + // * `last_modified_before` to the end of the day + google.protobuf.Timestamp last_modified_since = 5; + + // If specified, only objects with a "last modification time" before this + // timestamp and objects that don't have a "last modification time" are + // transferred. + google.protobuf.Timestamp last_modified_before = 6; +} + +// In a GcsData resource, an object's name is the Cloud Storage object's +// name and its "last modification time" refers to the object's `updated` +// property of Cloud Storage objects, which changes when the content or the +// metadata of the object is updated. +message GcsData { + // Required. Cloud Storage bucket name. Must meet + // [Bucket Name Requirements](/storage/docs/naming#requirements). + string bucket_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Root path to transfer objects. + // + // Must be an empty string or full path name that ends with a '/'. This field + // is treated as an object prefix. As such, it should generally not begin with + // a '/'. + // + // The root path value must meet + // [Object Name Requirements](/storage/docs/naming#objectnames). + string path = 3; +} + +// An AwsS3Data resource can be a data source, but not a data sink. +// In an AwsS3Data resource, an object's name is the S3 object's key name. +message AwsS3Data { + // Required. S3 Bucket name (see + // [Creating a + // bucket](https://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). + string bucket_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Input only. AWS access key used to sign the API requests to the AWS S3 bucket. + // Permissions on the bucket must be granted to the access ID of the AWS + // access key. + // + // For information on our data retention policy for user credentials, see + // [User credentials](/storage-transfer/docs/data-retention#user-credentials). + AwsAccessKey aws_access_key = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Root path to transfer objects. + // + // Must be an empty string or full path name that ends with a '/'. This field + // is treated as an object prefix. As such, it should generally not begin with + // a '/'. + string path = 3; + + // The Amazon Resource Name (ARN) of the role to support temporary + // credentials via `AssumeRoleWithWebIdentity`. For more information about + // ARNs, see [IAM + // ARNs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns). + // + // When a role ARN is provided, Transfer Service fetches temporary + // credentials for the session using a `AssumeRoleWithWebIdentity` call for + // the provided role using the [GoogleServiceAccount][google.storagetransfer.v1.GoogleServiceAccount] for this project. + string role_arn = 4; +} + +// An AzureBlobStorageData resource can be a data source, but not a data sink. +// An AzureBlobStorageData resource represents one Azure container. The storage +// account determines the [Azure +// endpoint](https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account#storage-account-endpoints). +// In an AzureBlobStorageData resource, a blobs's name is the [Azure Blob +// Storage blob's key +// name](https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#blob-names). +message AzureBlobStorageData { + // Required. The name of the Azure Storage account. + string storage_account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. Credentials used to authenticate API requests to Azure. + // + // For information on our data retention policy for user credentials, see + // [User credentials](/storage-transfer/docs/data-retention#user-credentials). + AzureCredentials azure_credentials = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Required. The container to transfer from the Azure Storage account. + string container = 4 [(google.api.field_behavior) = REQUIRED]; + + // Root path to transfer objects. + // + // Must be an empty string or full path name that ends with a '/'. This field + // is treated as an object prefix. As such, it should generally not begin with + // a '/'. + string path = 5; +} + +// An HttpData resource specifies a list of objects on the web to be transferred +// over HTTP. The information of the objects to be transferred is contained in +// a file referenced by a URL. The first line in the file must be +// `"TsvHttpData-1.0"`, which specifies the format of the file. Subsequent +// lines specify the information of the list of objects, one object per list +// entry. Each entry has the following tab-delimited fields: +// +// * **HTTP URL** — The location of the object. +// +// * **Length** — The size of the object in bytes. +// +// * **MD5** — The base64-encoded MD5 hash of the object. +// +// For an example of a valid TSV file, see +// [Transferring data from +// URLs](https://cloud.google.com/storage-transfer/docs/create-url-list). +// +// When transferring data based on a URL list, keep the following in mind: +// +// * When an object located at `http(s)://hostname:port/` is +// transferred to a data sink, the name of the object at the data sink is +// `/`. +// +// * If the specified size of an object does not match the actual size of the +// object fetched, the object is not transferred. +// +// * If the specified MD5 does not match the MD5 computed from the transferred +// bytes, the object transfer fails. +// +// * Ensure that each URL you specify is publicly accessible. For +// example, in Cloud Storage you can +// [share an object publicly] +// (/storage/docs/cloud-console#_sharingdata) and get a link to it. +// +// * Storage Transfer Service obeys `robots.txt` rules and requires the source +// HTTP server to support `Range` requests and to return a `Content-Length` +// header in each response. +// +// * [ObjectConditions][google.storagetransfer.v1.ObjectConditions] have no effect when filtering objects to transfer. +message HttpData { + // Required. The URL that points to the file that stores the object list + // entries. This file must allow public access. Currently, only URLs with + // HTTP and HTTPS schemes are supported. + string list_url = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A POSIX filesystem resource. +message PosixFilesystem { + // Root directory path to the filesystem. + string root_directory = 1; +} + +// An AwsS3CompatibleData resource. +message AwsS3CompatibleData { + // Required. Specifies the name of the bucket. + string bucket_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Specifies the root path to transfer objects. + // + // Must be an empty string or full path name that ends with a '/'. This + // field is treated as an object prefix. As such, it should generally not + // begin with a '/'. + string path = 2; + + // Required. Specifies the endpoint of the storage service. + string endpoint = 3 [(google.api.field_behavior) = REQUIRED]; + + // Specifies the region to sign requests with. This can be left blank if + // requests should be signed with an empty region. + string region = 5; + + // Specifies the metadata of the S3 compatible data provider. Each provider + // may contain some attributes that do not apply to all S3-compatible data + // providers. When not specified, S3CompatibleMetadata is used by default. + oneof data_provider { + // A S3 compatible metadata. + S3CompatibleMetadata s3_metadata = 4; + } +} + +// S3CompatibleMetadata contains the metadata fields that apply to the basic +// types of S3-compatible data providers. +message S3CompatibleMetadata { + // The authentication and authorization method used by the storage service. + enum AuthMethod { + // AuthMethod is not specified. + AUTH_METHOD_UNSPECIFIED = 0; + + // Auth requests with AWS SigV4. + AUTH_METHOD_AWS_SIGNATURE_V4 = 1; + + // Auth requests with AWS SigV2. + AUTH_METHOD_AWS_SIGNATURE_V2 = 2; + } + + // The request model of the API. + enum RequestModel { + // RequestModel is not specified. + REQUEST_MODEL_UNSPECIFIED = 0; + + // Perform requests using Virtual Hosted Style. + // Example: https://bucket-name.s3.region.amazonaws.com/key-name + REQUEST_MODEL_VIRTUAL_HOSTED_STYLE = 1; + + // Perform requests using Path Style. + // Example: https://s3.region.amazonaws.com/bucket-name/key-name + REQUEST_MODEL_PATH_STYLE = 2; + } + + // The agent network protocol to access the storage service. + enum NetworkProtocol { + // NetworkProtocol is not specified. + NETWORK_PROTOCOL_UNSPECIFIED = 0; + + // Perform requests using HTTPS. + NETWORK_PROTOCOL_HTTPS = 1; + + // Not recommended: This sends data in clear-text. This is only + // appropriate within a closed network or for publicly available data. + // Perform requests using HTTP. + NETWORK_PROTOCOL_HTTP = 2; + } + + // The Listing API to use for discovering objects. + enum ListApi { + // ListApi is not specified. + LIST_API_UNSPECIFIED = 0; + + // Perform listing using ListObjectsV2 API. + LIST_OBJECTS_V2 = 1; + + // Legacy ListObjects API. + LIST_OBJECTS = 2; + } + + // Specifies the authentication and authorization method used by the storage + // service. When not specified, Transfer Service will attempt to determine + // right auth method to use. + AuthMethod auth_method = 1; + + // Specifies the API request model used to call the storage service. When not + // specified, the default value of RequestModel + // REQUEST_MODEL_VIRTUAL_HOSTED_STYLE is used. + RequestModel request_model = 2; + + // Specifies the network protocol of the agent. When not specified, the + // default value of NetworkProtocol NETWORK_PROTOCOL_HTTPS is used. + NetworkProtocol protocol = 3; + + // The Listing API to use for discovering objects. When not specified, + // Transfer Service will attempt to determine the right API to use. + ListApi list_api = 4; +} + +// Represents an On-Premises Agent pool. +message AgentPool { + option (google.api.resource) = { + type: "storagetransfer.googleapis.com/agentPools" + pattern: "projects/{project_id}/agentPools/{agent_pool_id}" + }; + + // The state of an AgentPool. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // This is an initialization state. During this stage, the resources such as + // Pub/Sub topics are allocated for the AgentPool. + CREATING = 1; + + // Determines that the AgentPool is created for use. At this state, Agents + // can join the AgentPool and participate in the transfer jobs in that pool. + CREATED = 2; + + // Determines that the AgentPool deletion has been initiated, and all the + // resources are scheduled to be cleaned up and freed. + DELETING = 3; + } + + // Specifies a bandwidth limit for an agent pool. + message BandwidthLimit { + // Bandwidth rate in megabytes per second, distributed across all the agents + // in the pool. + int64 limit_mbps = 1; + } + + // Required. Specifies a unique string that identifies the agent pool. + // + // Format: `projects/{project_id}/agentPools/{agent_pool_id}` + string name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Specifies the client-specified AgentPool description. + string display_name = 3; + + // Output only. Specifies the state of the AgentPool. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Specifies the bandwidth limit details. If this field is unspecified, the + // default value is set as 'No Limit'. + BandwidthLimit bandwidth_limit = 5; +} + +// TransferOptions define the actions to be performed on objects in a transfer. +message TransferOptions { + // Specifies when to overwrite an object in the sink when an object with + // matching name is found in the source. + enum OverwriteWhen { + // Overwrite behavior is unspecified. + OVERWRITE_WHEN_UNSPECIFIED = 0; + + // Overwrites destination objects with the source objects, only if the + // objects have the same name but different HTTP ETags or checksum values. + DIFFERENT = 1; + + // Never overwrites a destination object if a source object has the + // same name. In this case, the source object is not transferred. + NEVER = 2; + + // Always overwrite the destination object with the source object, even if + // the HTTP Etags or checksum values are the same. + ALWAYS = 3; + } + + // When to overwrite objects that already exist in the sink. The default is + // that only objects that are different from the source are ovewritten. If + // true, all objects in the sink whose name matches an object in the source + // are overwritten with the source object. + bool overwrite_objects_already_existing_in_sink = 1; + + // Whether objects that exist only in the sink should be deleted. + // + // **Note:** This option and [delete_objects_from_source_after_transfer][google.storagetransfer.v1.TransferOptions.delete_objects_from_source_after_transfer] are + // mutually exclusive. + bool delete_objects_unique_in_sink = 2; + + // Whether objects should be deleted from the source after they are + // transferred to the sink. + // + // **Note:** This option and [delete_objects_unique_in_sink][google.storagetransfer.v1.TransferOptions.delete_objects_unique_in_sink] are mutually + // exclusive. + bool delete_objects_from_source_after_transfer = 3; + + // When to overwrite objects that already exist in the sink. If not set, + // overwrite behavior is determined by + // [overwrite_objects_already_existing_in_sink][google.storagetransfer.v1.TransferOptions.overwrite_objects_already_existing_in_sink]. + OverwriteWhen overwrite_when = 4; + + // Represents the selected metadata options for a transfer job. + MetadataOptions metadata_options = 5; +} + +// Configuration for running a transfer. +message TransferSpec { + // The write sink for the data. + oneof data_sink { + // A Cloud Storage data sink. + GcsData gcs_data_sink = 4; + + // A POSIX Filesystem data sink. + PosixFilesystem posix_data_sink = 13; + } + + // The read source of the data. + oneof data_source { + // A Cloud Storage data source. + GcsData gcs_data_source = 1; + + // An AWS S3 data source. + AwsS3Data aws_s3_data_source = 2; + + // An HTTP URL data source. + HttpData http_data_source = 3; + + // A POSIX Filesystem data source. + PosixFilesystem posix_data_source = 14; + + // An Azure Blob Storage data source. + AzureBlobStorageData azure_blob_storage_data_source = 8; + + // An AWS S3 compatible data source. + AwsS3CompatibleData aws_s3_compatible_data_source = 19; + } + + // Represents a supported data container type which is required for transfer + // jobs which needs a data source, a data sink and an intermediate location to + // transfer data through. This is validated on TransferJob creation. + oneof intermediate_data_location { + // Cloud Storage intermediate data location. + GcsData gcs_intermediate_data_location = 16; + } + + // Only objects that satisfy these object conditions are included in the set + // of data source and data sink objects. Object conditions based on + // objects' "last modification time" do not exclude objects in a data sink. + ObjectConditions object_conditions = 5; + + // If the option + // [delete_objects_unique_in_sink][google.storagetransfer.v1.TransferOptions.delete_objects_unique_in_sink] + // is `true` and time-based object conditions such as 'last modification time' + // are specified, the request fails with an + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. + TransferOptions transfer_options = 6; + + // A manifest file provides a list of objects to be transferred from the data + // source. This field points to the location of the manifest file. + // Otherwise, the entire source bucket is used. ObjectConditions still apply. + TransferManifest transfer_manifest = 15; + + // Specifies the agent pool name associated with the posix data source. When + // unspecified, the default name is used. + string source_agent_pool_name = 17; + + // Specifies the agent pool name associated with the posix data sink. When + // unspecified, the default name is used. + string sink_agent_pool_name = 18; +} + +// Specifies the metadata options for running a transfer. +message MetadataOptions { + // Whether symlinks should be skipped or preserved during a transfer job. + enum Symlink { + // Symlink behavior is unspecified. + SYMLINK_UNSPECIFIED = 0; + + // Do not preserve symlinks during a transfer job. + SYMLINK_SKIP = 1; + + // Preserve symlinks during a transfer job. + SYMLINK_PRESERVE = 2; + } + + // Options for handling file mode attribute. + enum Mode { + // Mode behavior is unspecified. + MODE_UNSPECIFIED = 0; + + // Do not preserve mode during a transfer job. + MODE_SKIP = 1; + + // Preserve mode during a transfer job. + MODE_PRESERVE = 2; + } + + // Options for handling file GID attribute. + enum GID { + // GID behavior is unspecified. + GID_UNSPECIFIED = 0; + + // Do not preserve GID during a transfer job. + GID_SKIP = 1; + + // Preserve GID during a transfer job. + GID_NUMBER = 2; + } + + // Options for handling file UID attribute. + enum UID { + // UID behavior is unspecified. + UID_UNSPECIFIED = 0; + + // Do not preserve UID during a transfer job. + UID_SKIP = 1; + + // Preserve UID during a transfer job. + UID_NUMBER = 2; + } + + // Options for handling Cloud Storage object ACLs. + enum Acl { + // ACL behavior is unspecified. + ACL_UNSPECIFIED = 0; + + // Use the destination bucket's default object ACLS, if applicable. + ACL_DESTINATION_BUCKET_DEFAULT = 1; + + // Preserve the object's original ACLs. This requires the service account + // to have `storage.objects.getIamPolicy` permission for the source object. + // [Uniform bucket-level + // access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) + // must not be enabled on either the source or destination buckets. + ACL_PRESERVE = 2; + } + + // Options for handling Google Cloud Storage object storage class. + enum StorageClass { + // Storage class behavior is unspecified. + STORAGE_CLASS_UNSPECIFIED = 0; + + // Use the destination bucket's default storage class. + STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT = 1; + + // Preserve the object's original storage class. This is only supported for + // transfers from Google Cloud Storage buckets. + STORAGE_CLASS_PRESERVE = 2; + + // Set the storage class to STANDARD. + STORAGE_CLASS_STANDARD = 3; + + // Set the storage class to NEARLINE. + STORAGE_CLASS_NEARLINE = 4; + + // Set the storage class to COLDLINE. + STORAGE_CLASS_COLDLINE = 5; + + // Set the storage class to ARCHIVE. + STORAGE_CLASS_ARCHIVE = 6; + } + + // Options for handling temporary holds for Google Cloud Storage objects. + enum TemporaryHold { + // Temporary hold behavior is unspecified. + TEMPORARY_HOLD_UNSPECIFIED = 0; + + // Do not set a temporary hold on the destination object. + TEMPORARY_HOLD_SKIP = 1; + + // Preserve the object's original temporary hold status. + TEMPORARY_HOLD_PRESERVE = 2; + } + + // Options for handling the KmsKey setting for Google Cloud Storage objects. + enum KmsKey { + // KmsKey behavior is unspecified. + KMS_KEY_UNSPECIFIED = 0; + + // Use the destination bucket's default encryption settings. + KMS_KEY_DESTINATION_BUCKET_DEFAULT = 1; + + // Preserve the object's original Cloud KMS customer-managed encryption key + // (CMEK) if present. Objects that do not use a Cloud KMS encryption key + // will be encrypted using the destination bucket's encryption settings. + KMS_KEY_PRESERVE = 2; + } + + // Options for handling `timeCreated` metadata for Google Cloud Storage + // objects. + enum TimeCreated { + // TimeCreated behavior is unspecified. + TIME_CREATED_UNSPECIFIED = 0; + + // Do not preserve the `timeCreated` metadata from the source object. + TIME_CREATED_SKIP = 1; + + // Preserves the source object's `timeCreated` metadata in the `customTime` + // field in the destination object. Note that any value stored in the + // source object's `customTime` field will not be propagated to the + // destination object. + TIME_CREATED_PRESERVE_AS_CUSTOM_TIME = 2; + } + + // Specifies how symlinks should be handled by the transfer. By default, + // symlinks are not preserved. Only applicable to transfers involving + // POSIX file systems, and ignored for other transfers. + Symlink symlink = 1; + + // Specifies how each file's mode attribute should be handled by the transfer. + // By default, mode is not preserved. Only applicable to transfers involving + // POSIX file systems, and ignored for other transfers. + Mode mode = 2; + + // Specifies how each file's POSIX group ID (GID) attribute should be handled + // by the transfer. By default, GID is not preserved. Only applicable to + // transfers involving POSIX file systems, and ignored for other transfers. + GID gid = 3; + + // Specifies how each file's POSIX user ID (UID) attribute should be handled + // by the transfer. By default, UID is not preserved. Only applicable to + // transfers involving POSIX file systems, and ignored for other transfers. + UID uid = 4; + + // Specifies how each object's ACLs should be preserved for transfers between + // Google Cloud Storage buckets. If unspecified, the default behavior is the + // same as ACL_DESTINATION_BUCKET_DEFAULT. + Acl acl = 5; + + // Specifies the storage class to set on objects being transferred to Google + // Cloud Storage buckets. If unspecified, the default behavior is the same as + // [STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT][google.storagetransfer.v1.MetadataOptions.StorageClass.STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT]. + StorageClass storage_class = 6; + + // Specifies how each object's temporary hold status should be preserved for + // transfers between Google Cloud Storage buckets. If unspecified, the + // default behavior is the same as + // [TEMPORARY_HOLD_PRESERVE][google.storagetransfer.v1.MetadataOptions.TemporaryHold.TEMPORARY_HOLD_PRESERVE]. + TemporaryHold temporary_hold = 7; + + // Specifies how each object's Cloud KMS customer-managed encryption key + // (CMEK) is preserved for transfers between Google Cloud Storage buckets. If + // unspecified, the default behavior is the same as + // [KMS_KEY_DESTINATION_BUCKET_DEFAULT][google.storagetransfer.v1.MetadataOptions.KmsKey.KMS_KEY_DESTINATION_BUCKET_DEFAULT]. + KmsKey kms_key = 8; + + // Specifies how each object's `timeCreated` metadata is preserved for + // transfers between Google Cloud Storage buckets. If unspecified, the + // default behavior is the same as + // [TIME_CREATED_SKIP][google.storagetransfer.v1.MetadataOptions.TimeCreated.TIME_CREATED_SKIP]. + TimeCreated time_created = 9; +} + +// Specifies where the manifest is located. +message TransferManifest { + // Specifies the path to the manifest in Cloud Storage. The Google-managed + // service account for the transfer must have `storage.objects.get` + // permission for this object. An example path is + // `gs://bucket_name/path/manifest.csv`. + string location = 1; +} + +// Transfers can be scheduled to recur or to run just once. +message Schedule { + // Required. The start date of a transfer. Date boundaries are determined + // relative to UTC time. If `schedule_start_date` and [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day] + // are in the past relative to the job's creation time, the transfer starts + // the day after you schedule the transfer request. + // + // **Note:** When starting jobs at or near midnight UTC it is possible that + // a job starts later than expected. For example, if you send an outbound + // request on June 1 one millisecond prior to midnight UTC and the Storage + // Transfer Service server receives the request on June 2, then it creates + // a TransferJob with `schedule_start_date` set to June 2 and a + // `start_time_of_day` set to midnight UTC. The first scheduled + // [TransferOperation][google.storagetransfer.v1.TransferOperation] takes place on June 3 at midnight UTC. + google.type.Date schedule_start_date = 1 [(google.api.field_behavior) = REQUIRED]; + + // The last day a transfer runs. Date boundaries are determined relative to + // UTC time. A job runs once per 24 hours within the following guidelines: + // + // * If `schedule_end_date` and [schedule_start_date][google.storagetransfer.v1.Schedule.schedule_start_date] are the same and in + // the future relative to UTC, the transfer is executed only one time. + // * If `schedule_end_date` is later than `schedule_start_date` and + // `schedule_end_date` is in the future relative to UTC, the job runs each + // day at [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day] through `schedule_end_date`. + google.type.Date schedule_end_date = 2; + + // The time in UTC that a transfer job is scheduled to run. Transfers may + // start later than this time. + // + // If `start_time_of_day` is not specified: + // + // * One-time transfers run immediately. + // * Recurring transfers run immediately, and each day at midnight UTC, + // through [schedule_end_date][google.storagetransfer.v1.Schedule.schedule_end_date]. + // + // If `start_time_of_day` is specified: + // + // * One-time transfers run at the specified time. + // * Recurring transfers run at the specified time each day, through + // `schedule_end_date`. + google.type.TimeOfDay start_time_of_day = 3; + + // The time in UTC that no further transfer operations are scheduled. Combined + // with [schedule_end_date][google.storagetransfer.v1.Schedule.schedule_end_date], `end_time_of_day` specifies the end date and + // time for starting new transfer operations. This field must be greater than + // or equal to the timestamp corresponding to the combintation of + // [schedule_start_date][google.storagetransfer.v1.Schedule.schedule_start_date] and [start_time_of_day][google.storagetransfer.v1.Schedule.start_time_of_day], and is subject to the + // following: + // + // * If `end_time_of_day` is not set and `schedule_end_date` is set, then + // a default value of `23:59:59` is used for `end_time_of_day`. + // + // * If `end_time_of_day` is set and `schedule_end_date` is not set, then + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] is returned. + google.type.TimeOfDay end_time_of_day = 4; + + // Interval between the start of each scheduled TransferOperation. If + // unspecified, the default value is 24 hours. This value may not be less than + // 1 hour. + google.protobuf.Duration repeat_interval = 5; +} + +// This resource represents the configuration of a transfer job that runs +// periodically. +message TransferJob { + // The status of the transfer job. + enum Status { + // Zero is an illegal value. + STATUS_UNSPECIFIED = 0; + + // New transfers are performed based on the schedule. + ENABLED = 1; + + // New transfers are not scheduled. + DISABLED = 2; + + // This is a soft delete state. After a transfer job is set to this + // state, the job and all the transfer executions are subject to + // garbage collection. Transfer jobs become eligible for garbage collection + // 30 days after their status is set to `DELETED`. + DELETED = 3; + } + + // A unique name (within the transfer project) assigned when the job is + // created. If this field is empty in a CreateTransferJobRequest, Storage + // Transfer Service assigns a unique name. Otherwise, the specified name + // is used as the unique name for this job. + // + // If the specified name is in use by a job, the creation request fails with + // an [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + // + // This name must start with `"transferJobs/"` prefix and end with a letter or + // a number, and should be no more than 128 characters. For transfers + // involving PosixFilesystem, this name must start with `transferJobs/OPI` + // specifically. For all other transfer types, this name must not start with + // `transferJobs/OPI`. + // + // Non-PosixFilesystem example: + // `"transferJobs/^(?!OPI)[A-Za-z0-9-._~]*[A-Za-z0-9]$"` + // + // PosixFilesystem example: + // `"transferJobs/OPI^[A-Za-z0-9-._~]*[A-Za-z0-9]$"` + // + // Applications must not rely on the enforcement of naming requirements + // involving OPI. + // + // Invalid job names fail with an + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. + string name = 1; + + // A description provided by the user for the job. Its max length is 1024 + // bytes when Unicode-encoded. + string description = 2; + + // The ID of the Google Cloud project that owns the job. + string project_id = 3; + + // Transfer specification. + TransferSpec transfer_spec = 4; + + // Notification configuration. This is not supported for transfers involving + // PosixFilesystem. + NotificationConfig notification_config = 11; + + // Logging configuration. + LoggingConfig logging_config = 14; + + // Specifies schedule for the transfer job. + // This is an optional field. When the field is not set, the job never + // executes a transfer, unless you invoke RunTransferJob or update the job to + // have a non-empty schedule. + Schedule schedule = 5; + + // Status of the job. This value MUST be specified for + // `CreateTransferJobRequests`. + // + // **Note:** The effect of the new job status takes place during a subsequent + // job run. For example, if you change the job status from + // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED] to [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and an operation + // spawned by the transfer is running, the status change would not affect the + // current operation. + Status status = 6; + + // Output only. The time that the transfer job was created. + google.protobuf.Timestamp creation_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time that the transfer job was last modified. + google.protobuf.Timestamp last_modification_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time that the transfer job was deleted. + google.protobuf.Timestamp deletion_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The name of the most recently started TransferOperation of this JobConfig. + // Present if a TransferOperation has been created for this JobConfig. + string latest_operation_name = 12; +} + +// An entry describing an error that has occurred. +message ErrorLogEntry { + // Required. A URL that refers to the target (a data source, a data sink, + // or an object) with which the error is associated. + string url = 1 [(google.api.field_behavior) = REQUIRED]; + + // A list of messages that carry the error details. + repeated string error_details = 3; +} + +// A summary of errors by error code, plus a count and sample error log +// entries. +message ErrorSummary { + // Required. + google.rpc.Code error_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Count of this type of error. + int64 error_count = 2 [(google.api.field_behavior) = REQUIRED]; + + // Error samples. + // + // At most 5 error log entries are recorded for a given + // error code for a single transfer operation. + repeated ErrorLogEntry error_log_entries = 3; +} + +// A collection of counters that report the progress of a transfer operation. +message TransferCounters { + // Objects found in the data source that are scheduled to be transferred, + // excluding any that are filtered based on object conditions or skipped due + // to sync. + int64 objects_found_from_source = 1; + + // Bytes found in the data source that are scheduled to be transferred, + // excluding any that are filtered based on object conditions or skipped due + // to sync. + int64 bytes_found_from_source = 2; + + // Objects found only in the data sink that are scheduled to be deleted. + int64 objects_found_only_from_sink = 3; + + // Bytes found only in the data sink that are scheduled to be deleted. + int64 bytes_found_only_from_sink = 4; + + // Objects in the data source that are not transferred because they already + // exist in the data sink. + int64 objects_from_source_skipped_by_sync = 5; + + // Bytes in the data source that are not transferred because they already + // exist in the data sink. + int64 bytes_from_source_skipped_by_sync = 6; + + // Objects that are copied to the data sink. + int64 objects_copied_to_sink = 7; + + // Bytes that are copied to the data sink. + int64 bytes_copied_to_sink = 8; + + // Objects that are deleted from the data source. + int64 objects_deleted_from_source = 9; + + // Bytes that are deleted from the data source. + int64 bytes_deleted_from_source = 10; + + // Objects that are deleted from the data sink. + int64 objects_deleted_from_sink = 11; + + // Bytes that are deleted from the data sink. + int64 bytes_deleted_from_sink = 12; + + // Objects in the data source that failed to be transferred or that failed + // to be deleted after being transferred. + int64 objects_from_source_failed = 13; + + // Bytes in the data source that failed to be transferred or that failed to + // be deleted after being transferred. + int64 bytes_from_source_failed = 14; + + // Objects that failed to be deleted from the data sink. + int64 objects_failed_to_delete_from_sink = 15; + + // Bytes that failed to be deleted from the data sink. + int64 bytes_failed_to_delete_from_sink = 16; + + // For transfers involving PosixFilesystem only. + // + // Number of directories found while listing. For example, if the root + // directory of the transfer is `base/` and there are two other directories, + // `a/` and `b/` under this directory, the count after listing `base/`, + // `base/a/` and `base/b/` is 3. + int64 directories_found_from_source = 17; + + // For transfers involving PosixFilesystem only. + // + // Number of listing failures for each directory found at the source. + // Potential failures when listing a directory include permission failure or + // block failure. If listing a directory fails, no files in the directory are + // transferred. + int64 directories_failed_to_list_from_source = 18; + + // For transfers involving PosixFilesystem only. + // + // Number of successful listings for each directory found at the source. + int64 directories_successfully_listed_from_source = 19; + + // Number of successfully cleaned up intermediate objects. + int64 intermediate_objects_cleaned_up = 22; + + // Number of intermediate objects failed cleaned up. + int64 intermediate_objects_failed_cleaned_up = 23; +} + +// Specification to configure notifications published to Pub/Sub. +// Notifications are published to the customer-provided topic using the +// following `PubsubMessage.attributes`: +// +// * `"eventType"`: one of the [EventType][google.storagetransfer.v1.NotificationConfig.EventType] values +// * `"payloadFormat"`: one of the [PayloadFormat][google.storagetransfer.v1.NotificationConfig.PayloadFormat] values +// * `"projectId"`: the [project_id][google.storagetransfer.v1.TransferOperation.project_id] of the +// `TransferOperation` +// * `"transferJobName"`: the +// [transfer_job_name][google.storagetransfer.v1.TransferOperation.transfer_job_name] of the +// `TransferOperation` +// * `"transferOperationName"`: the [name][google.storagetransfer.v1.TransferOperation.name] of the +// `TransferOperation` +// +// The `PubsubMessage.data` contains a [TransferOperation][google.storagetransfer.v1.TransferOperation] resource +// formatted according to the specified `PayloadFormat`. +message NotificationConfig { + // Enum for specifying event types for which notifications are to be + // published. + // + // Additional event types may be added in the future. Clients should either + // safely ignore unrecognized event types or explicitly specify which event + // types they are prepared to accept. + enum EventType { + // Illegal value, to avoid allowing a default. + EVENT_TYPE_UNSPECIFIED = 0; + + // `TransferOperation` completed with status + // [SUCCESS][google.storagetransfer.v1.TransferOperation.Status.SUCCESS]. + TRANSFER_OPERATION_SUCCESS = 1; + + // `TransferOperation` completed with status + // [FAILED][google.storagetransfer.v1.TransferOperation.Status.FAILED]. + TRANSFER_OPERATION_FAILED = 2; + + // `TransferOperation` completed with status + // [ABORTED][google.storagetransfer.v1.TransferOperation.Status.ABORTED]. + TRANSFER_OPERATION_ABORTED = 3; + } + + // Enum for specifying the format of a notification message's payload. + enum PayloadFormat { + // Illegal value, to avoid allowing a default. + PAYLOAD_FORMAT_UNSPECIFIED = 0; + + // No payload is included with the notification. + NONE = 1; + + // `TransferOperation` is [formatted as a JSON + // response](https://developers.google.com/protocol-buffers/docs/proto3#json), + // in application/json. + JSON = 2; + } + + // Required. The `Topic.name` of the Pub/Sub topic to which to publish + // notifications. Must be of the format: `projects/{project}/topics/{topic}`. + // Not matching this format results in an + // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. + string pubsub_topic = 1 [(google.api.field_behavior) = REQUIRED]; + + // Event types for which a notification is desired. If empty, send + // notifications for all event types. + repeated EventType event_types = 2; + + // Required. The desired format of the notification message payloads. + PayloadFormat payload_format = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the logging behavior for transfer operations. +// +// For cloud-to-cloud transfers, logs are sent to Cloud Logging. See +// [Read transfer +// logs](https://cloud.google.com/storage-transfer/docs/read-transfer-logs) for +// details. +// +// For transfers to or from a POSIX file system, logs are stored in the +// Cloud Storage bucket that is the source or sink of the transfer. +// See [Managing Transfer for on-premises jobs] +// (https://cloud.google.com/storage-transfer/docs/managing-on-prem-jobs#viewing-logs) +// for details. +message LoggingConfig { + // Loggable actions. + enum LoggableAction { + // Default value. This value is unused. + LOGGABLE_ACTION_UNSPECIFIED = 0; + + // Listing objects in a bucket. + FIND = 1; + + // Deleting objects at the source or the destination. + DELETE = 2; + + // Copying objects to Google Cloud Storage. + COPY = 3; + } + + // Loggable action states. + enum LoggableActionState { + // Default value. This value is unused. + LOGGABLE_ACTION_STATE_UNSPECIFIED = 0; + + // `LoggableAction` completed successfully. `SUCCEEDED` actions are + // logged as [INFO][google.logging.type.LogSeverity.INFO]. + SUCCEEDED = 1; + + // `LoggableAction` terminated in an error state. `FAILED` actions are + // logged as [ERROR][google.logging.type.LogSeverity.ERROR]. + FAILED = 2; + } + + // Specifies the actions to be logged. If empty, no logs are generated. + // Not supported for transfers with PosixFilesystem data sources; use + // [enable_onprem_gcs_transfer_logs][google.storagetransfer.v1.LoggingConfig.enable_onprem_gcs_transfer_logs] instead. + repeated LoggableAction log_actions = 1; + + // States in which `log_actions` are logged. If empty, no logs are generated. + // Not supported for transfers with PosixFilesystem data sources; use + // [enable_onprem_gcs_transfer_logs][google.storagetransfer.v1.LoggingConfig.enable_onprem_gcs_transfer_logs] instead. + repeated LoggableActionState log_action_states = 2; + + // For transfers with a PosixFilesystem source, this option enables the Cloud + // Storage transfer logs for this transfer. + bool enable_onprem_gcs_transfer_logs = 3; +} + +// A description of the execution of a transfer. +message TransferOperation { + // The status of a TransferOperation. + enum Status { + // Zero is an illegal value. + STATUS_UNSPECIFIED = 0; + + // In progress. + IN_PROGRESS = 1; + + // Paused. + PAUSED = 2; + + // Completed successfully. + SUCCESS = 3; + + // Terminated due to an unrecoverable failure. + FAILED = 4; + + // Aborted by the user. + ABORTED = 5; + + // Temporarily delayed by the system. No user action is required. + QUEUED = 6; + } + + // A globally unique ID assigned by the system. + string name = 1; + + // The ID of the Google Cloud project that owns the operation. + string project_id = 2; + + // Transfer specification. + TransferSpec transfer_spec = 3; + + // Notification configuration. + NotificationConfig notification_config = 10; + + // Start time of this transfer execution. + google.protobuf.Timestamp start_time = 4; + + // End time of this transfer execution. + google.protobuf.Timestamp end_time = 5; + + // Status of the transfer operation. + Status status = 6; + + // Information about the progress of the transfer operation. + TransferCounters counters = 7; + + // Summarizes errors encountered with sample error log entries. + repeated ErrorSummary error_breakdowns = 8; + + // The name of the transfer job that triggers this transfer operation. + string transfer_job_name = 9; +} diff --git a/packages/google-storagetransfer/protos/protos.d.ts b/packages/google-storagetransfer/protos/protos.d.ts new file mode 100644 index 00000000000..5d77e90b631 --- /dev/null +++ b/packages/google-storagetransfer/protos/protos.d.ts @@ -0,0 +1,11023 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace storagetransfer. */ + namespace storagetransfer { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a StorageTransferService */ + class StorageTransferService extends $protobuf.rpc.Service { + + /** + * Constructs a new StorageTransferService 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 StorageTransferService 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): StorageTransferService; + + /** + * Calls GetGoogleServiceAccount. + * @param request GetGoogleServiceAccountRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GoogleServiceAccount + */ + public getGoogleServiceAccount(request: google.storagetransfer.v1.IGetGoogleServiceAccountRequest, callback: google.storagetransfer.v1.StorageTransferService.GetGoogleServiceAccountCallback): void; + + /** + * Calls GetGoogleServiceAccount. + * @param request GetGoogleServiceAccountRequest message or plain object + * @returns Promise + */ + public getGoogleServiceAccount(request: google.storagetransfer.v1.IGetGoogleServiceAccountRequest): Promise; + + /** + * Calls CreateTransferJob. + * @param request CreateTransferJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferJob + */ + public createTransferJob(request: google.storagetransfer.v1.ICreateTransferJobRequest, callback: google.storagetransfer.v1.StorageTransferService.CreateTransferJobCallback): void; + + /** + * Calls CreateTransferJob. + * @param request CreateTransferJobRequest message or plain object + * @returns Promise + */ + public createTransferJob(request: google.storagetransfer.v1.ICreateTransferJobRequest): Promise; + + /** + * Calls UpdateTransferJob. + * @param request UpdateTransferJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferJob + */ + public updateTransferJob(request: google.storagetransfer.v1.IUpdateTransferJobRequest, callback: google.storagetransfer.v1.StorageTransferService.UpdateTransferJobCallback): void; + + /** + * Calls UpdateTransferJob. + * @param request UpdateTransferJobRequest message or plain object + * @returns Promise + */ + public updateTransferJob(request: google.storagetransfer.v1.IUpdateTransferJobRequest): Promise; + + /** + * Calls GetTransferJob. + * @param request GetTransferJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferJob + */ + public getTransferJob(request: google.storagetransfer.v1.IGetTransferJobRequest, callback: google.storagetransfer.v1.StorageTransferService.GetTransferJobCallback): void; + + /** + * Calls GetTransferJob. + * @param request GetTransferJobRequest message or plain object + * @returns Promise + */ + public getTransferJob(request: google.storagetransfer.v1.IGetTransferJobRequest): Promise; + + /** + * Calls ListTransferJobs. + * @param request ListTransferJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTransferJobsResponse + */ + public listTransferJobs(request: google.storagetransfer.v1.IListTransferJobsRequest, callback: google.storagetransfer.v1.StorageTransferService.ListTransferJobsCallback): void; + + /** + * Calls ListTransferJobs. + * @param request ListTransferJobsRequest message or plain object + * @returns Promise + */ + public listTransferJobs(request: google.storagetransfer.v1.IListTransferJobsRequest): Promise; + + /** + * Calls PauseTransferOperation. + * @param request PauseTransferOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public pauseTransferOperation(request: google.storagetransfer.v1.IPauseTransferOperationRequest, callback: google.storagetransfer.v1.StorageTransferService.PauseTransferOperationCallback): void; + + /** + * Calls PauseTransferOperation. + * @param request PauseTransferOperationRequest message or plain object + * @returns Promise + */ + public pauseTransferOperation(request: google.storagetransfer.v1.IPauseTransferOperationRequest): Promise; + + /** + * Calls ResumeTransferOperation. + * @param request ResumeTransferOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public resumeTransferOperation(request: google.storagetransfer.v1.IResumeTransferOperationRequest, callback: google.storagetransfer.v1.StorageTransferService.ResumeTransferOperationCallback): void; + + /** + * Calls ResumeTransferOperation. + * @param request ResumeTransferOperationRequest message or plain object + * @returns Promise + */ + public resumeTransferOperation(request: google.storagetransfer.v1.IResumeTransferOperationRequest): Promise; + + /** + * Calls RunTransferJob. + * @param request RunTransferJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runTransferJob(request: google.storagetransfer.v1.IRunTransferJobRequest, callback: google.storagetransfer.v1.StorageTransferService.RunTransferJobCallback): void; + + /** + * Calls RunTransferJob. + * @param request RunTransferJobRequest message or plain object + * @returns Promise + */ + public runTransferJob(request: google.storagetransfer.v1.IRunTransferJobRequest): Promise; + + /** + * Calls DeleteTransferJob. + * @param request DeleteTransferJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTransferJob(request: google.storagetransfer.v1.IDeleteTransferJobRequest, callback: google.storagetransfer.v1.StorageTransferService.DeleteTransferJobCallback): void; + + /** + * Calls DeleteTransferJob. + * @param request DeleteTransferJobRequest message or plain object + * @returns Promise + */ + public deleteTransferJob(request: google.storagetransfer.v1.IDeleteTransferJobRequest): Promise; + + /** + * Calls CreateAgentPool. + * @param request CreateAgentPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AgentPool + */ + public createAgentPool(request: google.storagetransfer.v1.ICreateAgentPoolRequest, callback: google.storagetransfer.v1.StorageTransferService.CreateAgentPoolCallback): void; + + /** + * Calls CreateAgentPool. + * @param request CreateAgentPoolRequest message or plain object + * @returns Promise + */ + public createAgentPool(request: google.storagetransfer.v1.ICreateAgentPoolRequest): Promise; + + /** + * Calls UpdateAgentPool. + * @param request UpdateAgentPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AgentPool + */ + public updateAgentPool(request: google.storagetransfer.v1.IUpdateAgentPoolRequest, callback: google.storagetransfer.v1.StorageTransferService.UpdateAgentPoolCallback): void; + + /** + * Calls UpdateAgentPool. + * @param request UpdateAgentPoolRequest message or plain object + * @returns Promise + */ + public updateAgentPool(request: google.storagetransfer.v1.IUpdateAgentPoolRequest): Promise; + + /** + * Calls GetAgentPool. + * @param request GetAgentPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AgentPool + */ + public getAgentPool(request: google.storagetransfer.v1.IGetAgentPoolRequest, callback: google.storagetransfer.v1.StorageTransferService.GetAgentPoolCallback): void; + + /** + * Calls GetAgentPool. + * @param request GetAgentPoolRequest message or plain object + * @returns Promise + */ + public getAgentPool(request: google.storagetransfer.v1.IGetAgentPoolRequest): Promise; + + /** + * Calls ListAgentPools. + * @param request ListAgentPoolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAgentPoolsResponse + */ + public listAgentPools(request: google.storagetransfer.v1.IListAgentPoolsRequest, callback: google.storagetransfer.v1.StorageTransferService.ListAgentPoolsCallback): void; + + /** + * Calls ListAgentPools. + * @param request ListAgentPoolsRequest message or plain object + * @returns Promise + */ + public listAgentPools(request: google.storagetransfer.v1.IListAgentPoolsRequest): Promise; + + /** + * Calls DeleteAgentPool. + * @param request DeleteAgentPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAgentPool(request: google.storagetransfer.v1.IDeleteAgentPoolRequest, callback: google.storagetransfer.v1.StorageTransferService.DeleteAgentPoolCallback): void; + + /** + * Calls DeleteAgentPool. + * @param request DeleteAgentPoolRequest message or plain object + * @returns Promise + */ + public deleteAgentPool(request: google.storagetransfer.v1.IDeleteAgentPoolRequest): Promise; + } + + namespace StorageTransferService { + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|getGoogleServiceAccount}. + * @param error Error, if any + * @param [response] GoogleServiceAccount + */ + type GetGoogleServiceAccountCallback = (error: (Error|null), response?: google.storagetransfer.v1.GoogleServiceAccount) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|createTransferJob}. + * @param error Error, if any + * @param [response] TransferJob + */ + type CreateTransferJobCallback = (error: (Error|null), response?: google.storagetransfer.v1.TransferJob) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|updateTransferJob}. + * @param error Error, if any + * @param [response] TransferJob + */ + type UpdateTransferJobCallback = (error: (Error|null), response?: google.storagetransfer.v1.TransferJob) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|getTransferJob}. + * @param error Error, if any + * @param [response] TransferJob + */ + type GetTransferJobCallback = (error: (Error|null), response?: google.storagetransfer.v1.TransferJob) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|listTransferJobs}. + * @param error Error, if any + * @param [response] ListTransferJobsResponse + */ + type ListTransferJobsCallback = (error: (Error|null), response?: google.storagetransfer.v1.ListTransferJobsResponse) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|pauseTransferOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type PauseTransferOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|resumeTransferOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type ResumeTransferOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|runTransferJob}. + * @param error Error, if any + * @param [response] Operation + */ + type RunTransferJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|deleteTransferJob}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTransferJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|createAgentPool}. + * @param error Error, if any + * @param [response] AgentPool + */ + type CreateAgentPoolCallback = (error: (Error|null), response?: google.storagetransfer.v1.AgentPool) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|updateAgentPool}. + * @param error Error, if any + * @param [response] AgentPool + */ + type UpdateAgentPoolCallback = (error: (Error|null), response?: google.storagetransfer.v1.AgentPool) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|getAgentPool}. + * @param error Error, if any + * @param [response] AgentPool + */ + type GetAgentPoolCallback = (error: (Error|null), response?: google.storagetransfer.v1.AgentPool) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|listAgentPools}. + * @param error Error, if any + * @param [response] ListAgentPoolsResponse + */ + type ListAgentPoolsCallback = (error: (Error|null), response?: google.storagetransfer.v1.ListAgentPoolsResponse) => void; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|deleteAgentPool}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAgentPoolCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a GetGoogleServiceAccountRequest. */ + interface IGetGoogleServiceAccountRequest { + + /** GetGoogleServiceAccountRequest projectId */ + projectId?: (string|null); + } + + /** Represents a GetGoogleServiceAccountRequest. */ + class GetGoogleServiceAccountRequest implements IGetGoogleServiceAccountRequest { + + /** + * Constructs a new GetGoogleServiceAccountRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IGetGoogleServiceAccountRequest); + + /** GetGoogleServiceAccountRequest projectId. */ + public projectId: string; + + /** + * Creates a new GetGoogleServiceAccountRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGoogleServiceAccountRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IGetGoogleServiceAccountRequest): google.storagetransfer.v1.GetGoogleServiceAccountRequest; + + /** + * Encodes the specified GetGoogleServiceAccountRequest message. Does not implicitly {@link google.storagetransfer.v1.GetGoogleServiceAccountRequest.verify|verify} messages. + * @param message GetGoogleServiceAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IGetGoogleServiceAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGoogleServiceAccountRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GetGoogleServiceAccountRequest.verify|verify} messages. + * @param message GetGoogleServiceAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IGetGoogleServiceAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGoogleServiceAccountRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGoogleServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.GetGoogleServiceAccountRequest; + + /** + * Decodes a GetGoogleServiceAccountRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGoogleServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.GetGoogleServiceAccountRequest; + + /** + * Verifies a GetGoogleServiceAccountRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGoogleServiceAccountRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGoogleServiceAccountRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.GetGoogleServiceAccountRequest; + + /** + * Creates a plain object from a GetGoogleServiceAccountRequest message. Also converts values to other types if specified. + * @param message GetGoogleServiceAccountRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.GetGoogleServiceAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGoogleServiceAccountRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGoogleServiceAccountRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTransferJobRequest. */ + interface ICreateTransferJobRequest { + + /** CreateTransferJobRequest transferJob */ + transferJob?: (google.storagetransfer.v1.ITransferJob|null); + } + + /** Represents a CreateTransferJobRequest. */ + class CreateTransferJobRequest implements ICreateTransferJobRequest { + + /** + * Constructs a new CreateTransferJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ICreateTransferJobRequest); + + /** CreateTransferJobRequest transferJob. */ + public transferJob?: (google.storagetransfer.v1.ITransferJob|null); + + /** + * Creates a new CreateTransferJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTransferJobRequest instance + */ + public static create(properties?: google.storagetransfer.v1.ICreateTransferJobRequest): google.storagetransfer.v1.CreateTransferJobRequest; + + /** + * Encodes the specified CreateTransferJobRequest message. Does not implicitly {@link google.storagetransfer.v1.CreateTransferJobRequest.verify|verify} messages. + * @param message CreateTransferJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ICreateTransferJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTransferJobRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.CreateTransferJobRequest.verify|verify} messages. + * @param message CreateTransferJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ICreateTransferJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTransferJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.CreateTransferJobRequest; + + /** + * Decodes a CreateTransferJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.CreateTransferJobRequest; + + /** + * Verifies a CreateTransferJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTransferJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTransferJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.CreateTransferJobRequest; + + /** + * Creates a plain object from a CreateTransferJobRequest message. Also converts values to other types if specified. + * @param message CreateTransferJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.CreateTransferJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTransferJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTransferJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTransferJobRequest. */ + interface IUpdateTransferJobRequest { + + /** UpdateTransferJobRequest jobName */ + jobName?: (string|null); + + /** UpdateTransferJobRequest projectId */ + projectId?: (string|null); + + /** UpdateTransferJobRequest transferJob */ + transferJob?: (google.storagetransfer.v1.ITransferJob|null); + + /** UpdateTransferJobRequest updateTransferJobFieldMask */ + updateTransferJobFieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTransferJobRequest. */ + class UpdateTransferJobRequest implements IUpdateTransferJobRequest { + + /** + * Constructs a new UpdateTransferJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IUpdateTransferJobRequest); + + /** UpdateTransferJobRequest jobName. */ + public jobName: string; + + /** UpdateTransferJobRequest projectId. */ + public projectId: string; + + /** UpdateTransferJobRequest transferJob. */ + public transferJob?: (google.storagetransfer.v1.ITransferJob|null); + + /** UpdateTransferJobRequest updateTransferJobFieldMask. */ + public updateTransferJobFieldMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTransferJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTransferJobRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IUpdateTransferJobRequest): google.storagetransfer.v1.UpdateTransferJobRequest; + + /** + * Encodes the specified UpdateTransferJobRequest message. Does not implicitly {@link google.storagetransfer.v1.UpdateTransferJobRequest.verify|verify} messages. + * @param message UpdateTransferJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IUpdateTransferJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTransferJobRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.UpdateTransferJobRequest.verify|verify} messages. + * @param message UpdateTransferJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IUpdateTransferJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTransferJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.UpdateTransferJobRequest; + + /** + * Decodes an UpdateTransferJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.UpdateTransferJobRequest; + + /** + * Verifies an UpdateTransferJobRequest message. + * @param message Plain 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 UpdateTransferJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTransferJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.UpdateTransferJobRequest; + + /** + * Creates a plain object from an UpdateTransferJobRequest message. Also converts values to other types if specified. + * @param message UpdateTransferJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.UpdateTransferJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTransferJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTransferJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTransferJobRequest. */ + interface IGetTransferJobRequest { + + /** GetTransferJobRequest jobName */ + jobName?: (string|null); + + /** GetTransferJobRequest projectId */ + projectId?: (string|null); + } + + /** Represents a GetTransferJobRequest. */ + class GetTransferJobRequest implements IGetTransferJobRequest { + + /** + * Constructs a new GetTransferJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IGetTransferJobRequest); + + /** GetTransferJobRequest jobName. */ + public jobName: string; + + /** GetTransferJobRequest projectId. */ + public projectId: string; + + /** + * Creates a new GetTransferJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTransferJobRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IGetTransferJobRequest): google.storagetransfer.v1.GetTransferJobRequest; + + /** + * Encodes the specified GetTransferJobRequest message. Does not implicitly {@link google.storagetransfer.v1.GetTransferJobRequest.verify|verify} messages. + * @param message GetTransferJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IGetTransferJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTransferJobRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GetTransferJobRequest.verify|verify} messages. + * @param message GetTransferJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IGetTransferJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTransferJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.GetTransferJobRequest; + + /** + * Decodes a GetTransferJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.GetTransferJobRequest; + + /** + * Verifies a GetTransferJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTransferJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTransferJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.GetTransferJobRequest; + + /** + * Creates a plain object from a GetTransferJobRequest message. Also converts values to other types if specified. + * @param message GetTransferJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.GetTransferJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTransferJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTransferJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTransferJobRequest. */ + interface IDeleteTransferJobRequest { + + /** DeleteTransferJobRequest jobName */ + jobName?: (string|null); + + /** DeleteTransferJobRequest projectId */ + projectId?: (string|null); + } + + /** Represents a DeleteTransferJobRequest. */ + class DeleteTransferJobRequest implements IDeleteTransferJobRequest { + + /** + * Constructs a new DeleteTransferJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IDeleteTransferJobRequest); + + /** DeleteTransferJobRequest jobName. */ + public jobName: string; + + /** DeleteTransferJobRequest projectId. */ + public projectId: string; + + /** + * Creates a new DeleteTransferJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTransferJobRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IDeleteTransferJobRequest): google.storagetransfer.v1.DeleteTransferJobRequest; + + /** + * Encodes the specified DeleteTransferJobRequest message. Does not implicitly {@link google.storagetransfer.v1.DeleteTransferJobRequest.verify|verify} messages. + * @param message DeleteTransferJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IDeleteTransferJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTransferJobRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.DeleteTransferJobRequest.verify|verify} messages. + * @param message DeleteTransferJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IDeleteTransferJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTransferJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.DeleteTransferJobRequest; + + /** + * Decodes a DeleteTransferJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.DeleteTransferJobRequest; + + /** + * Verifies a DeleteTransferJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTransferJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTransferJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.DeleteTransferJobRequest; + + /** + * Creates a plain object from a DeleteTransferJobRequest message. Also converts values to other types if specified. + * @param message DeleteTransferJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.DeleteTransferJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTransferJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTransferJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferJobsRequest. */ + interface IListTransferJobsRequest { + + /** ListTransferJobsRequest filter */ + filter?: (string|null); + + /** ListTransferJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListTransferJobsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTransferJobsRequest. */ + class ListTransferJobsRequest implements IListTransferJobsRequest { + + /** + * Constructs a new ListTransferJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IListTransferJobsRequest); + + /** ListTransferJobsRequest filter. */ + public filter: string; + + /** ListTransferJobsRequest pageSize. */ + public pageSize: number; + + /** ListTransferJobsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTransferJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferJobsRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IListTransferJobsRequest): google.storagetransfer.v1.ListTransferJobsRequest; + + /** + * Encodes the specified ListTransferJobsRequest message. Does not implicitly {@link google.storagetransfer.v1.ListTransferJobsRequest.verify|verify} messages. + * @param message ListTransferJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IListTransferJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferJobsRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListTransferJobsRequest.verify|verify} messages. + * @param message ListTransferJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IListTransferJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.ListTransferJobsRequest; + + /** + * Decodes a ListTransferJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.ListTransferJobsRequest; + + /** + * Verifies a ListTransferJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ListTransferJobsRequest; + + /** + * Creates a plain object from a ListTransferJobsRequest message. Also converts values to other types if specified. + * @param message ListTransferJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.ListTransferJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferJobsResponse. */ + interface IListTransferJobsResponse { + + /** ListTransferJobsResponse transferJobs */ + transferJobs?: (google.storagetransfer.v1.ITransferJob[]|null); + + /** ListTransferJobsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTransferJobsResponse. */ + class ListTransferJobsResponse implements IListTransferJobsResponse { + + /** + * Constructs a new ListTransferJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IListTransferJobsResponse); + + /** ListTransferJobsResponse transferJobs. */ + public transferJobs: google.storagetransfer.v1.ITransferJob[]; + + /** ListTransferJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTransferJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferJobsResponse instance + */ + public static create(properties?: google.storagetransfer.v1.IListTransferJobsResponse): google.storagetransfer.v1.ListTransferJobsResponse; + + /** + * Encodes the specified ListTransferJobsResponse message. Does not implicitly {@link google.storagetransfer.v1.ListTransferJobsResponse.verify|verify} messages. + * @param message ListTransferJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IListTransferJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferJobsResponse message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListTransferJobsResponse.verify|verify} messages. + * @param message ListTransferJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IListTransferJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.ListTransferJobsResponse; + + /** + * Decodes a ListTransferJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.ListTransferJobsResponse; + + /** + * Verifies a ListTransferJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ListTransferJobsResponse; + + /** + * Creates a plain object from a ListTransferJobsResponse message. Also converts values to other types if specified. + * @param message ListTransferJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.ListTransferJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PauseTransferOperationRequest. */ + interface IPauseTransferOperationRequest { + + /** PauseTransferOperationRequest name */ + name?: (string|null); + } + + /** Represents a PauseTransferOperationRequest. */ + class PauseTransferOperationRequest implements IPauseTransferOperationRequest { + + /** + * Constructs a new PauseTransferOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IPauseTransferOperationRequest); + + /** PauseTransferOperationRequest name. */ + public name: string; + + /** + * Creates a new PauseTransferOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PauseTransferOperationRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IPauseTransferOperationRequest): google.storagetransfer.v1.PauseTransferOperationRequest; + + /** + * Encodes the specified PauseTransferOperationRequest message. Does not implicitly {@link google.storagetransfer.v1.PauseTransferOperationRequest.verify|verify} messages. + * @param message PauseTransferOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IPauseTransferOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PauseTransferOperationRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.PauseTransferOperationRequest.verify|verify} messages. + * @param message PauseTransferOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IPauseTransferOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PauseTransferOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PauseTransferOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.PauseTransferOperationRequest; + + /** + * Decodes a PauseTransferOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PauseTransferOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.PauseTransferOperationRequest; + + /** + * Verifies a PauseTransferOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PauseTransferOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PauseTransferOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.PauseTransferOperationRequest; + + /** + * Creates a plain object from a PauseTransferOperationRequest message. Also converts values to other types if specified. + * @param message PauseTransferOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.PauseTransferOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PauseTransferOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PauseTransferOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResumeTransferOperationRequest. */ + interface IResumeTransferOperationRequest { + + /** ResumeTransferOperationRequest name */ + name?: (string|null); + } + + /** Represents a ResumeTransferOperationRequest. */ + class ResumeTransferOperationRequest implements IResumeTransferOperationRequest { + + /** + * Constructs a new ResumeTransferOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IResumeTransferOperationRequest); + + /** ResumeTransferOperationRequest name. */ + public name: string; + + /** + * Creates a new ResumeTransferOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResumeTransferOperationRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IResumeTransferOperationRequest): google.storagetransfer.v1.ResumeTransferOperationRequest; + + /** + * Encodes the specified ResumeTransferOperationRequest message. Does not implicitly {@link google.storagetransfer.v1.ResumeTransferOperationRequest.verify|verify} messages. + * @param message ResumeTransferOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IResumeTransferOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResumeTransferOperationRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ResumeTransferOperationRequest.verify|verify} messages. + * @param message ResumeTransferOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IResumeTransferOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResumeTransferOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResumeTransferOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.ResumeTransferOperationRequest; + + /** + * Decodes a ResumeTransferOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResumeTransferOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.ResumeTransferOperationRequest; + + /** + * Verifies a ResumeTransferOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResumeTransferOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResumeTransferOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ResumeTransferOperationRequest; + + /** + * Creates a plain object from a ResumeTransferOperationRequest message. Also converts values to other types if specified. + * @param message ResumeTransferOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.ResumeTransferOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResumeTransferOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResumeTransferOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunTransferJobRequest. */ + interface IRunTransferJobRequest { + + /** RunTransferJobRequest jobName */ + jobName?: (string|null); + + /** RunTransferJobRequest projectId */ + projectId?: (string|null); + } + + /** Represents a RunTransferJobRequest. */ + class RunTransferJobRequest implements IRunTransferJobRequest { + + /** + * Constructs a new RunTransferJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IRunTransferJobRequest); + + /** RunTransferJobRequest jobName. */ + public jobName: string; + + /** RunTransferJobRequest projectId. */ + public projectId: string; + + /** + * Creates a new RunTransferJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunTransferJobRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IRunTransferJobRequest): google.storagetransfer.v1.RunTransferJobRequest; + + /** + * Encodes the specified RunTransferJobRequest message. Does not implicitly {@link google.storagetransfer.v1.RunTransferJobRequest.verify|verify} messages. + * @param message RunTransferJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IRunTransferJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunTransferJobRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.RunTransferJobRequest.verify|verify} messages. + * @param message RunTransferJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IRunTransferJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunTransferJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.RunTransferJobRequest; + + /** + * Decodes a RunTransferJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.RunTransferJobRequest; + + /** + * Verifies a RunTransferJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunTransferJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunTransferJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.RunTransferJobRequest; + + /** + * Creates a plain object from a RunTransferJobRequest message. Also converts values to other types if specified. + * @param message RunTransferJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.RunTransferJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunTransferJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunTransferJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAgentPoolRequest. */ + interface ICreateAgentPoolRequest { + + /** CreateAgentPoolRequest projectId */ + projectId?: (string|null); + + /** CreateAgentPoolRequest agentPool */ + agentPool?: (google.storagetransfer.v1.IAgentPool|null); + + /** CreateAgentPoolRequest agentPoolId */ + agentPoolId?: (string|null); + } + + /** Represents a CreateAgentPoolRequest. */ + class CreateAgentPoolRequest implements ICreateAgentPoolRequest { + + /** + * Constructs a new CreateAgentPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ICreateAgentPoolRequest); + + /** CreateAgentPoolRequest projectId. */ + public projectId: string; + + /** CreateAgentPoolRequest agentPool. */ + public agentPool?: (google.storagetransfer.v1.IAgentPool|null); + + /** CreateAgentPoolRequest agentPoolId. */ + public agentPoolId: string; + + /** + * Creates a new CreateAgentPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAgentPoolRequest instance + */ + public static create(properties?: google.storagetransfer.v1.ICreateAgentPoolRequest): google.storagetransfer.v1.CreateAgentPoolRequest; + + /** + * Encodes the specified CreateAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.CreateAgentPoolRequest.verify|verify} messages. + * @param message CreateAgentPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ICreateAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.CreateAgentPoolRequest.verify|verify} messages. + * @param message CreateAgentPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ICreateAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAgentPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.CreateAgentPoolRequest; + + /** + * Decodes a CreateAgentPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.CreateAgentPoolRequest; + + /** + * Verifies a CreateAgentPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAgentPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAgentPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.CreateAgentPoolRequest; + + /** + * Creates a plain object from a CreateAgentPoolRequest message. Also converts values to other types if specified. + * @param message CreateAgentPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.CreateAgentPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAgentPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAgentPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAgentPoolRequest. */ + interface IUpdateAgentPoolRequest { + + /** UpdateAgentPoolRequest agentPool */ + agentPool?: (google.storagetransfer.v1.IAgentPool|null); + + /** UpdateAgentPoolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAgentPoolRequest. */ + class UpdateAgentPoolRequest implements IUpdateAgentPoolRequest { + + /** + * Constructs a new UpdateAgentPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IUpdateAgentPoolRequest); + + /** UpdateAgentPoolRequest agentPool. */ + public agentPool?: (google.storagetransfer.v1.IAgentPool|null); + + /** UpdateAgentPoolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAgentPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAgentPoolRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IUpdateAgentPoolRequest): google.storagetransfer.v1.UpdateAgentPoolRequest; + + /** + * Encodes the specified UpdateAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.UpdateAgentPoolRequest.verify|verify} messages. + * @param message UpdateAgentPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IUpdateAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.UpdateAgentPoolRequest.verify|verify} messages. + * @param message UpdateAgentPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IUpdateAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAgentPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.UpdateAgentPoolRequest; + + /** + * Decodes an UpdateAgentPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.UpdateAgentPoolRequest; + + /** + * Verifies an UpdateAgentPoolRequest message. + * @param message Plain 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 UpdateAgentPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAgentPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.UpdateAgentPoolRequest; + + /** + * Creates a plain object from an UpdateAgentPoolRequest message. Also converts values to other types if specified. + * @param message UpdateAgentPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.UpdateAgentPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAgentPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAgentPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAgentPoolRequest. */ + interface IGetAgentPoolRequest { + + /** GetAgentPoolRequest name */ + name?: (string|null); + } + + /** Represents a GetAgentPoolRequest. */ + class GetAgentPoolRequest implements IGetAgentPoolRequest { + + /** + * Constructs a new GetAgentPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IGetAgentPoolRequest); + + /** GetAgentPoolRequest name. */ + public name: string; + + /** + * Creates a new GetAgentPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAgentPoolRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IGetAgentPoolRequest): google.storagetransfer.v1.GetAgentPoolRequest; + + /** + * Encodes the specified GetAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.GetAgentPoolRequest.verify|verify} messages. + * @param message GetAgentPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IGetAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GetAgentPoolRequest.verify|verify} messages. + * @param message GetAgentPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IGetAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAgentPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.GetAgentPoolRequest; + + /** + * Decodes a GetAgentPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.GetAgentPoolRequest; + + /** + * Verifies a GetAgentPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAgentPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAgentPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.GetAgentPoolRequest; + + /** + * Creates a plain object from a GetAgentPoolRequest message. Also converts values to other types if specified. + * @param message GetAgentPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.GetAgentPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAgentPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAgentPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAgentPoolRequest. */ + interface IDeleteAgentPoolRequest { + + /** DeleteAgentPoolRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAgentPoolRequest. */ + class DeleteAgentPoolRequest implements IDeleteAgentPoolRequest { + + /** + * Constructs a new DeleteAgentPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IDeleteAgentPoolRequest); + + /** DeleteAgentPoolRequest name. */ + public name: string; + + /** + * Creates a new DeleteAgentPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAgentPoolRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IDeleteAgentPoolRequest): google.storagetransfer.v1.DeleteAgentPoolRequest; + + /** + * Encodes the specified DeleteAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.DeleteAgentPoolRequest.verify|verify} messages. + * @param message DeleteAgentPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IDeleteAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.DeleteAgentPoolRequest.verify|verify} messages. + * @param message DeleteAgentPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IDeleteAgentPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAgentPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.DeleteAgentPoolRequest; + + /** + * Decodes a DeleteAgentPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.DeleteAgentPoolRequest; + + /** + * Verifies a DeleteAgentPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAgentPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAgentPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.DeleteAgentPoolRequest; + + /** + * Creates a plain object from a DeleteAgentPoolRequest message. Also converts values to other types if specified. + * @param message DeleteAgentPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.DeleteAgentPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAgentPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAgentPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAgentPoolsRequest. */ + interface IListAgentPoolsRequest { + + /** ListAgentPoolsRequest projectId */ + projectId?: (string|null); + + /** ListAgentPoolsRequest filter */ + filter?: (string|null); + + /** ListAgentPoolsRequest pageSize */ + pageSize?: (number|null); + + /** ListAgentPoolsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAgentPoolsRequest. */ + class ListAgentPoolsRequest implements IListAgentPoolsRequest { + + /** + * Constructs a new ListAgentPoolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IListAgentPoolsRequest); + + /** ListAgentPoolsRequest projectId. */ + public projectId: string; + + /** ListAgentPoolsRequest filter. */ + public filter: string; + + /** ListAgentPoolsRequest pageSize. */ + public pageSize: number; + + /** ListAgentPoolsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAgentPoolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentPoolsRequest instance + */ + public static create(properties?: google.storagetransfer.v1.IListAgentPoolsRequest): google.storagetransfer.v1.ListAgentPoolsRequest; + + /** + * Encodes the specified ListAgentPoolsRequest message. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsRequest.verify|verify} messages. + * @param message ListAgentPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IListAgentPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentPoolsRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsRequest.verify|verify} messages. + * @param message ListAgentPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IListAgentPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentPoolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.ListAgentPoolsRequest; + + /** + * Decodes a ListAgentPoolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.ListAgentPoolsRequest; + + /** + * Verifies a ListAgentPoolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAgentPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentPoolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ListAgentPoolsRequest; + + /** + * Creates a plain object from a ListAgentPoolsRequest message. Also converts values to other types if specified. + * @param message ListAgentPoolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.ListAgentPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentPoolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentPoolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAgentPoolsResponse. */ + interface IListAgentPoolsResponse { + + /** ListAgentPoolsResponse agentPools */ + agentPools?: (google.storagetransfer.v1.IAgentPool[]|null); + + /** ListAgentPoolsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAgentPoolsResponse. */ + class ListAgentPoolsResponse implements IListAgentPoolsResponse { + + /** + * Constructs a new ListAgentPoolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IListAgentPoolsResponse); + + /** ListAgentPoolsResponse agentPools. */ + public agentPools: google.storagetransfer.v1.IAgentPool[]; + + /** ListAgentPoolsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAgentPoolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAgentPoolsResponse instance + */ + public static create(properties?: google.storagetransfer.v1.IListAgentPoolsResponse): google.storagetransfer.v1.ListAgentPoolsResponse; + + /** + * Encodes the specified ListAgentPoolsResponse message. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsResponse.verify|verify} messages. + * @param message ListAgentPoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IListAgentPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAgentPoolsResponse message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsResponse.verify|verify} messages. + * @param message ListAgentPoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IListAgentPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAgentPoolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAgentPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.ListAgentPoolsResponse; + + /** + * Decodes a ListAgentPoolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAgentPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.ListAgentPoolsResponse; + + /** + * Verifies a ListAgentPoolsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAgentPoolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAgentPoolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ListAgentPoolsResponse; + + /** + * Creates a plain object from a ListAgentPoolsResponse message. Also converts values to other types if specified. + * @param message ListAgentPoolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.ListAgentPoolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAgentPoolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAgentPoolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoogleServiceAccount. */ + interface IGoogleServiceAccount { + + /** GoogleServiceAccount accountEmail */ + accountEmail?: (string|null); + + /** GoogleServiceAccount subjectId */ + subjectId?: (string|null); + } + + /** Represents a GoogleServiceAccount. */ + class GoogleServiceAccount implements IGoogleServiceAccount { + + /** + * Constructs a new GoogleServiceAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IGoogleServiceAccount); + + /** GoogleServiceAccount accountEmail. */ + public accountEmail: string; + + /** GoogleServiceAccount subjectId. */ + public subjectId: string; + + /** + * Creates a new GoogleServiceAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleServiceAccount instance + */ + public static create(properties?: google.storagetransfer.v1.IGoogleServiceAccount): google.storagetransfer.v1.GoogleServiceAccount; + + /** + * Encodes the specified GoogleServiceAccount message. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. + * @param message GoogleServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IGoogleServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleServiceAccount message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. + * @param message GoogleServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IGoogleServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleServiceAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.GoogleServiceAccount; + + /** + * Decodes a GoogleServiceAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.GoogleServiceAccount; + + /** + * Verifies a GoogleServiceAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleServiceAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleServiceAccount + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.GoogleServiceAccount; + + /** + * Creates a plain object from a GoogleServiceAccount message. Also converts values to other types if specified. + * @param message GoogleServiceAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.GoogleServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleServiceAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleServiceAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwsAccessKey. */ + interface IAwsAccessKey { + + /** AwsAccessKey accessKeyId */ + accessKeyId?: (string|null); + + /** AwsAccessKey secretAccessKey */ + secretAccessKey?: (string|null); + } + + /** Represents an AwsAccessKey. */ + class AwsAccessKey implements IAwsAccessKey { + + /** + * Constructs a new AwsAccessKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IAwsAccessKey); + + /** AwsAccessKey accessKeyId. */ + public accessKeyId: string; + + /** AwsAccessKey secretAccessKey. */ + public secretAccessKey: string; + + /** + * Creates a new AwsAccessKey instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsAccessKey instance + */ + public static create(properties?: google.storagetransfer.v1.IAwsAccessKey): google.storagetransfer.v1.AwsAccessKey; + + /** + * Encodes the specified AwsAccessKey message. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. + * @param message AwsAccessKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IAwsAccessKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsAccessKey message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. + * @param message AwsAccessKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IAwsAccessKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsAccessKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsAccessKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.AwsAccessKey; + + /** + * Decodes an AwsAccessKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsAccessKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.AwsAccessKey; + + /** + * Verifies an AwsAccessKey message. + * @param message Plain 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 AwsAccessKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsAccessKey + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AwsAccessKey; + + /** + * Creates a plain object from an AwsAccessKey message. Also converts values to other types if specified. + * @param message AwsAccessKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AwsAccessKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsAccessKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsAccessKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AzureCredentials. */ + interface IAzureCredentials { + + /** AzureCredentials sasToken */ + sasToken?: (string|null); + } + + /** Represents an AzureCredentials. */ + class AzureCredentials implements IAzureCredentials { + + /** + * Constructs a new AzureCredentials. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IAzureCredentials); + + /** AzureCredentials sasToken. */ + public sasToken: string; + + /** + * Creates a new AzureCredentials instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureCredentials instance + */ + public static create(properties?: google.storagetransfer.v1.IAzureCredentials): google.storagetransfer.v1.AzureCredentials; + + /** + * Encodes the specified AzureCredentials message. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. + * @param message AzureCredentials message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IAzureCredentials, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureCredentials message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. + * @param message AzureCredentials message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IAzureCredentials, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureCredentials message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureCredentials + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.AzureCredentials; + + /** + * Decodes an AzureCredentials message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureCredentials + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.AzureCredentials; + + /** + * Verifies an AzureCredentials message. + * @param message Plain 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 AzureCredentials message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureCredentials + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AzureCredentials; + + /** + * Creates a plain object from an AzureCredentials message. Also converts values to other types if specified. + * @param message AzureCredentials + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AzureCredentials, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureCredentials to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureCredentials + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectConditions. */ + interface IObjectConditions { + + /** ObjectConditions minTimeElapsedSinceLastModification */ + minTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); + + /** ObjectConditions maxTimeElapsedSinceLastModification */ + maxTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); + + /** ObjectConditions includePrefixes */ + includePrefixes?: (string[]|null); + + /** ObjectConditions excludePrefixes */ + excludePrefixes?: (string[]|null); + + /** ObjectConditions lastModifiedSince */ + lastModifiedSince?: (google.protobuf.ITimestamp|null); + + /** ObjectConditions lastModifiedBefore */ + lastModifiedBefore?: (google.protobuf.ITimestamp|null); + } + + /** Represents an ObjectConditions. */ + class ObjectConditions implements IObjectConditions { + + /** + * Constructs a new ObjectConditions. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IObjectConditions); + + /** ObjectConditions minTimeElapsedSinceLastModification. */ + public minTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); + + /** ObjectConditions maxTimeElapsedSinceLastModification. */ + public maxTimeElapsedSinceLastModification?: (google.protobuf.IDuration|null); + + /** ObjectConditions includePrefixes. */ + public includePrefixes: string[]; + + /** ObjectConditions excludePrefixes. */ + public excludePrefixes: string[]; + + /** ObjectConditions lastModifiedSince. */ + public lastModifiedSince?: (google.protobuf.ITimestamp|null); + + /** ObjectConditions lastModifiedBefore. */ + public lastModifiedBefore?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ObjectConditions instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectConditions instance + */ + public static create(properties?: google.storagetransfer.v1.IObjectConditions): google.storagetransfer.v1.ObjectConditions; + + /** + * Encodes the specified ObjectConditions message. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. + * @param message ObjectConditions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IObjectConditions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectConditions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. + * @param message ObjectConditions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IObjectConditions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectConditions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectConditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.ObjectConditions; + + /** + * Decodes an ObjectConditions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectConditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.ObjectConditions; + + /** + * Verifies an ObjectConditions message. + * @param message Plain 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 ObjectConditions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectConditions + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ObjectConditions; + + /** + * Creates a plain object from an ObjectConditions message. Also converts values to other types if specified. + * @param message ObjectConditions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.ObjectConditions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectConditions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectConditions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsData. */ + interface IGcsData { + + /** GcsData bucketName */ + bucketName?: (string|null); + + /** GcsData path */ + path?: (string|null); + } + + /** Represents a GcsData. */ + class GcsData implements IGcsData { + + /** + * Constructs a new GcsData. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IGcsData); + + /** GcsData bucketName. */ + public bucketName: string; + + /** GcsData path. */ + public path: string; + + /** + * Creates a new GcsData instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsData instance + */ + public static create(properties?: google.storagetransfer.v1.IGcsData): google.storagetransfer.v1.GcsData; + + /** + * Encodes the specified GcsData message. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. + * @param message GcsData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IGcsData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. + * @param message GcsData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IGcsData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.GcsData; + + /** + * Decodes a GcsData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.GcsData; + + /** + * Verifies a GcsData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsData + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.GcsData; + + /** + * Creates a plain object from a GcsData message. Also converts values to other types if specified. + * @param message GcsData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.GcsData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwsS3Data. */ + interface IAwsS3Data { + + /** AwsS3Data bucketName */ + bucketName?: (string|null); + + /** AwsS3Data awsAccessKey */ + awsAccessKey?: (google.storagetransfer.v1.IAwsAccessKey|null); + + /** AwsS3Data path */ + path?: (string|null); + + /** AwsS3Data roleArn */ + roleArn?: (string|null); + } + + /** Represents an AwsS3Data. */ + class AwsS3Data implements IAwsS3Data { + + /** + * Constructs a new AwsS3Data. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IAwsS3Data); + + /** AwsS3Data bucketName. */ + public bucketName: string; + + /** AwsS3Data awsAccessKey. */ + public awsAccessKey?: (google.storagetransfer.v1.IAwsAccessKey|null); + + /** AwsS3Data path. */ + public path: string; + + /** AwsS3Data roleArn. */ + public roleArn: string; + + /** + * Creates a new AwsS3Data instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsS3Data instance + */ + public static create(properties?: google.storagetransfer.v1.IAwsS3Data): google.storagetransfer.v1.AwsS3Data; + + /** + * Encodes the specified AwsS3Data message. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. + * @param message AwsS3Data message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IAwsS3Data, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsS3Data message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. + * @param message AwsS3Data message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IAwsS3Data, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsS3Data message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsS3Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.AwsS3Data; + + /** + * Decodes an AwsS3Data message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsS3Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.AwsS3Data; + + /** + * Verifies an AwsS3Data message. + * @param message Plain 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 AwsS3Data message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsS3Data + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AwsS3Data; + + /** + * Creates a plain object from an AwsS3Data message. Also converts values to other types if specified. + * @param message AwsS3Data + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AwsS3Data, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsS3Data to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsS3Data + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AzureBlobStorageData. */ + interface IAzureBlobStorageData { + + /** AzureBlobStorageData storageAccount */ + storageAccount?: (string|null); + + /** AzureBlobStorageData azureCredentials */ + azureCredentials?: (google.storagetransfer.v1.IAzureCredentials|null); + + /** AzureBlobStorageData container */ + container?: (string|null); + + /** AzureBlobStorageData path */ + path?: (string|null); + } + + /** Represents an AzureBlobStorageData. */ + class AzureBlobStorageData implements IAzureBlobStorageData { + + /** + * Constructs a new AzureBlobStorageData. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IAzureBlobStorageData); + + /** AzureBlobStorageData storageAccount. */ + public storageAccount: string; + + /** AzureBlobStorageData azureCredentials. */ + public azureCredentials?: (google.storagetransfer.v1.IAzureCredentials|null); + + /** AzureBlobStorageData container. */ + public container: string; + + /** AzureBlobStorageData path. */ + public path: string; + + /** + * Creates a new AzureBlobStorageData instance using the specified properties. + * @param [properties] Properties to set + * @returns AzureBlobStorageData instance + */ + public static create(properties?: google.storagetransfer.v1.IAzureBlobStorageData): google.storagetransfer.v1.AzureBlobStorageData; + + /** + * Encodes the specified AzureBlobStorageData message. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. + * @param message AzureBlobStorageData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IAzureBlobStorageData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AzureBlobStorageData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. + * @param message AzureBlobStorageData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IAzureBlobStorageData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AzureBlobStorageData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AzureBlobStorageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.AzureBlobStorageData; + + /** + * Decodes an AzureBlobStorageData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AzureBlobStorageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.AzureBlobStorageData; + + /** + * Verifies an AzureBlobStorageData message. + * @param message Plain 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 AzureBlobStorageData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AzureBlobStorageData + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AzureBlobStorageData; + + /** + * Creates a plain object from an AzureBlobStorageData message. Also converts values to other types if specified. + * @param message AzureBlobStorageData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AzureBlobStorageData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AzureBlobStorageData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AzureBlobStorageData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpData. */ + interface IHttpData { + + /** HttpData listUrl */ + listUrl?: (string|null); + } + + /** Represents a HttpData. */ + class HttpData implements IHttpData { + + /** + * Constructs a new HttpData. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IHttpData); + + /** HttpData listUrl. */ + public listUrl: string; + + /** + * Creates a new HttpData instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpData instance + */ + public static create(properties?: google.storagetransfer.v1.IHttpData): google.storagetransfer.v1.HttpData; + + /** + * Encodes the specified HttpData message. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. + * @param message HttpData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IHttpData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. + * @param message HttpData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IHttpData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.HttpData; + + /** + * Decodes a HttpData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.HttpData; + + /** + * Verifies a HttpData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpData + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.HttpData; + + /** + * Creates a plain object from a HttpData message. Also converts values to other types if specified. + * @param message HttpData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.HttpData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PosixFilesystem. */ + interface IPosixFilesystem { + + /** PosixFilesystem rootDirectory */ + rootDirectory?: (string|null); + } + + /** Represents a PosixFilesystem. */ + class PosixFilesystem implements IPosixFilesystem { + + /** + * Constructs a new PosixFilesystem. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IPosixFilesystem); + + /** PosixFilesystem rootDirectory. */ + public rootDirectory: string; + + /** + * Creates a new PosixFilesystem instance using the specified properties. + * @param [properties] Properties to set + * @returns PosixFilesystem instance + */ + public static create(properties?: google.storagetransfer.v1.IPosixFilesystem): google.storagetransfer.v1.PosixFilesystem; + + /** + * Encodes the specified PosixFilesystem message. Does not implicitly {@link google.storagetransfer.v1.PosixFilesystem.verify|verify} messages. + * @param message PosixFilesystem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IPosixFilesystem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PosixFilesystem message, length delimited. Does not implicitly {@link google.storagetransfer.v1.PosixFilesystem.verify|verify} messages. + * @param message PosixFilesystem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IPosixFilesystem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PosixFilesystem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PosixFilesystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.PosixFilesystem; + + /** + * Decodes a PosixFilesystem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PosixFilesystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.PosixFilesystem; + + /** + * Verifies a PosixFilesystem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PosixFilesystem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PosixFilesystem + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.PosixFilesystem; + + /** + * Creates a plain object from a PosixFilesystem message. Also converts values to other types if specified. + * @param message PosixFilesystem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.PosixFilesystem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PosixFilesystem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PosixFilesystem + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwsS3CompatibleData. */ + interface IAwsS3CompatibleData { + + /** AwsS3CompatibleData bucketName */ + bucketName?: (string|null); + + /** AwsS3CompatibleData path */ + path?: (string|null); + + /** AwsS3CompatibleData endpoint */ + endpoint?: (string|null); + + /** AwsS3CompatibleData region */ + region?: (string|null); + + /** AwsS3CompatibleData s3Metadata */ + s3Metadata?: (google.storagetransfer.v1.IS3CompatibleMetadata|null); + } + + /** Represents an AwsS3CompatibleData. */ + class AwsS3CompatibleData implements IAwsS3CompatibleData { + + /** + * Constructs a new AwsS3CompatibleData. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IAwsS3CompatibleData); + + /** AwsS3CompatibleData bucketName. */ + public bucketName: string; + + /** AwsS3CompatibleData path. */ + public path: string; + + /** AwsS3CompatibleData endpoint. */ + public endpoint: string; + + /** AwsS3CompatibleData region. */ + public region: string; + + /** AwsS3CompatibleData s3Metadata. */ + public s3Metadata?: (google.storagetransfer.v1.IS3CompatibleMetadata|null); + + /** AwsS3CompatibleData dataProvider. */ + public dataProvider?: "s3Metadata"; + + /** + * Creates a new AwsS3CompatibleData instance using the specified properties. + * @param [properties] Properties to set + * @returns AwsS3CompatibleData instance + */ + public static create(properties?: google.storagetransfer.v1.IAwsS3CompatibleData): google.storagetransfer.v1.AwsS3CompatibleData; + + /** + * Encodes the specified AwsS3CompatibleData message. Does not implicitly {@link google.storagetransfer.v1.AwsS3CompatibleData.verify|verify} messages. + * @param message AwsS3CompatibleData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IAwsS3CompatibleData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AwsS3CompatibleData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsS3CompatibleData.verify|verify} messages. + * @param message AwsS3CompatibleData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IAwsS3CompatibleData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AwsS3CompatibleData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwsS3CompatibleData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.AwsS3CompatibleData; + + /** + * Decodes an AwsS3CompatibleData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwsS3CompatibleData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.AwsS3CompatibleData; + + /** + * Verifies an AwsS3CompatibleData message. + * @param message Plain 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 AwsS3CompatibleData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwsS3CompatibleData + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AwsS3CompatibleData; + + /** + * Creates a plain object from an AwsS3CompatibleData message. Also converts values to other types if specified. + * @param message AwsS3CompatibleData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AwsS3CompatibleData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AwsS3CompatibleData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwsS3CompatibleData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a S3CompatibleMetadata. */ + interface IS3CompatibleMetadata { + + /** S3CompatibleMetadata authMethod */ + authMethod?: (google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod|keyof typeof google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod|null); + + /** S3CompatibleMetadata requestModel */ + requestModel?: (google.storagetransfer.v1.S3CompatibleMetadata.RequestModel|keyof typeof google.storagetransfer.v1.S3CompatibleMetadata.RequestModel|null); + + /** S3CompatibleMetadata protocol */ + protocol?: (google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol|keyof typeof google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol|null); + + /** S3CompatibleMetadata listApi */ + listApi?: (google.storagetransfer.v1.S3CompatibleMetadata.ListApi|keyof typeof google.storagetransfer.v1.S3CompatibleMetadata.ListApi|null); + } + + /** Represents a S3CompatibleMetadata. */ + class S3CompatibleMetadata implements IS3CompatibleMetadata { + + /** + * Constructs a new S3CompatibleMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IS3CompatibleMetadata); + + /** S3CompatibleMetadata authMethod. */ + public authMethod: (google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod|keyof typeof google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod); + + /** S3CompatibleMetadata requestModel. */ + public requestModel: (google.storagetransfer.v1.S3CompatibleMetadata.RequestModel|keyof typeof google.storagetransfer.v1.S3CompatibleMetadata.RequestModel); + + /** S3CompatibleMetadata protocol. */ + public protocol: (google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol|keyof typeof google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol); + + /** S3CompatibleMetadata listApi. */ + public listApi: (google.storagetransfer.v1.S3CompatibleMetadata.ListApi|keyof typeof google.storagetransfer.v1.S3CompatibleMetadata.ListApi); + + /** + * Creates a new S3CompatibleMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns S3CompatibleMetadata instance + */ + public static create(properties?: google.storagetransfer.v1.IS3CompatibleMetadata): google.storagetransfer.v1.S3CompatibleMetadata; + + /** + * Encodes the specified S3CompatibleMetadata message. Does not implicitly {@link google.storagetransfer.v1.S3CompatibleMetadata.verify|verify} messages. + * @param message S3CompatibleMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IS3CompatibleMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified S3CompatibleMetadata message, length delimited. Does not implicitly {@link google.storagetransfer.v1.S3CompatibleMetadata.verify|verify} messages. + * @param message S3CompatibleMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IS3CompatibleMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a S3CompatibleMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns S3CompatibleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.S3CompatibleMetadata; + + /** + * Decodes a S3CompatibleMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns S3CompatibleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.S3CompatibleMetadata; + + /** + * Verifies a S3CompatibleMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a S3CompatibleMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns S3CompatibleMetadata + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.S3CompatibleMetadata; + + /** + * Creates a plain object from a S3CompatibleMetadata message. Also converts values to other types if specified. + * @param message S3CompatibleMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.S3CompatibleMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this S3CompatibleMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for S3CompatibleMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace S3CompatibleMetadata { + + /** AuthMethod enum. */ + enum AuthMethod { + AUTH_METHOD_UNSPECIFIED = 0, + AUTH_METHOD_AWS_SIGNATURE_V4 = 1, + AUTH_METHOD_AWS_SIGNATURE_V2 = 2 + } + + /** RequestModel enum. */ + enum RequestModel { + REQUEST_MODEL_UNSPECIFIED = 0, + REQUEST_MODEL_VIRTUAL_HOSTED_STYLE = 1, + REQUEST_MODEL_PATH_STYLE = 2 + } + + /** NetworkProtocol enum. */ + enum NetworkProtocol { + NETWORK_PROTOCOL_UNSPECIFIED = 0, + NETWORK_PROTOCOL_HTTPS = 1, + NETWORK_PROTOCOL_HTTP = 2 + } + + /** ListApi enum. */ + enum ListApi { + LIST_API_UNSPECIFIED = 0, + LIST_OBJECTS_V2 = 1, + LIST_OBJECTS = 2 + } + } + + /** Properties of an AgentPool. */ + interface IAgentPool { + + /** AgentPool name */ + name?: (string|null); + + /** AgentPool displayName */ + displayName?: (string|null); + + /** AgentPool state */ + state?: (google.storagetransfer.v1.AgentPool.State|keyof typeof google.storagetransfer.v1.AgentPool.State|null); + + /** AgentPool bandwidthLimit */ + bandwidthLimit?: (google.storagetransfer.v1.AgentPool.IBandwidthLimit|null); + } + + /** Represents an AgentPool. */ + class AgentPool implements IAgentPool { + + /** + * Constructs a new AgentPool. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IAgentPool); + + /** AgentPool name. */ + public name: string; + + /** AgentPool displayName. */ + public displayName: string; + + /** AgentPool state. */ + public state: (google.storagetransfer.v1.AgentPool.State|keyof typeof google.storagetransfer.v1.AgentPool.State); + + /** AgentPool bandwidthLimit. */ + public bandwidthLimit?: (google.storagetransfer.v1.AgentPool.IBandwidthLimit|null); + + /** + * Creates a new AgentPool instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentPool instance + */ + public static create(properties?: google.storagetransfer.v1.IAgentPool): google.storagetransfer.v1.AgentPool; + + /** + * Encodes the specified AgentPool message. Does not implicitly {@link google.storagetransfer.v1.AgentPool.verify|verify} messages. + * @param message AgentPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IAgentPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentPool message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AgentPool.verify|verify} messages. + * @param message AgentPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IAgentPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentPool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.AgentPool; + + /** + * Decodes an AgentPool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.AgentPool; + + /** + * Verifies an AgentPool message. + * @param message Plain 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 AgentPool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentPool + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AgentPool; + + /** + * Creates a plain object from an AgentPool message. Also converts values to other types if specified. + * @param message AgentPool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AgentPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentPool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AgentPool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AgentPool { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + CREATED = 2, + DELETING = 3 + } + + /** Properties of a BandwidthLimit. */ + interface IBandwidthLimit { + + /** BandwidthLimit limitMbps */ + limitMbps?: (number|Long|string|null); + } + + /** Represents a BandwidthLimit. */ + class BandwidthLimit implements IBandwidthLimit { + + /** + * Constructs a new BandwidthLimit. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.AgentPool.IBandwidthLimit); + + /** BandwidthLimit limitMbps. */ + public limitMbps: (number|Long|string); + + /** + * Creates a new BandwidthLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns BandwidthLimit instance + */ + public static create(properties?: google.storagetransfer.v1.AgentPool.IBandwidthLimit): google.storagetransfer.v1.AgentPool.BandwidthLimit; + + /** + * Encodes the specified BandwidthLimit message. Does not implicitly {@link google.storagetransfer.v1.AgentPool.BandwidthLimit.verify|verify} messages. + * @param message BandwidthLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.AgentPool.IBandwidthLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BandwidthLimit message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AgentPool.BandwidthLimit.verify|verify} messages. + * @param message BandwidthLimit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.AgentPool.IBandwidthLimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BandwidthLimit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BandwidthLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.AgentPool.BandwidthLimit; + + /** + * Decodes a BandwidthLimit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BandwidthLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.AgentPool.BandwidthLimit; + + /** + * Verifies a BandwidthLimit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BandwidthLimit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BandwidthLimit + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.AgentPool.BandwidthLimit; + + /** + * Creates a plain object from a BandwidthLimit message. Also converts values to other types if specified. + * @param message BandwidthLimit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.AgentPool.BandwidthLimit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BandwidthLimit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BandwidthLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TransferOptions. */ + interface ITransferOptions { + + /** TransferOptions overwriteObjectsAlreadyExistingInSink */ + overwriteObjectsAlreadyExistingInSink?: (boolean|null); + + /** TransferOptions deleteObjectsUniqueInSink */ + deleteObjectsUniqueInSink?: (boolean|null); + + /** TransferOptions deleteObjectsFromSourceAfterTransfer */ + deleteObjectsFromSourceAfterTransfer?: (boolean|null); + + /** TransferOptions overwriteWhen */ + overwriteWhen?: (google.storagetransfer.v1.TransferOptions.OverwriteWhen|keyof typeof google.storagetransfer.v1.TransferOptions.OverwriteWhen|null); + + /** TransferOptions metadataOptions */ + metadataOptions?: (google.storagetransfer.v1.IMetadataOptions|null); + } + + /** Represents a TransferOptions. */ + class TransferOptions implements ITransferOptions { + + /** + * Constructs a new TransferOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ITransferOptions); + + /** TransferOptions overwriteObjectsAlreadyExistingInSink. */ + public overwriteObjectsAlreadyExistingInSink: boolean; + + /** TransferOptions deleteObjectsUniqueInSink. */ + public deleteObjectsUniqueInSink: boolean; + + /** TransferOptions deleteObjectsFromSourceAfterTransfer. */ + public deleteObjectsFromSourceAfterTransfer: boolean; + + /** TransferOptions overwriteWhen. */ + public overwriteWhen: (google.storagetransfer.v1.TransferOptions.OverwriteWhen|keyof typeof google.storagetransfer.v1.TransferOptions.OverwriteWhen); + + /** TransferOptions metadataOptions. */ + public metadataOptions?: (google.storagetransfer.v1.IMetadataOptions|null); + + /** + * Creates a new TransferOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferOptions instance + */ + public static create(properties?: google.storagetransfer.v1.ITransferOptions): google.storagetransfer.v1.TransferOptions; + + /** + * Encodes the specified TransferOptions message. Does not implicitly {@link google.storagetransfer.v1.TransferOptions.verify|verify} messages. + * @param message TransferOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ITransferOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferOptions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferOptions.verify|verify} messages. + * @param message TransferOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ITransferOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.TransferOptions; + + /** + * Decodes a TransferOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.TransferOptions; + + /** + * Verifies a TransferOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferOptions + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.TransferOptions; + + /** + * Creates a plain object from a TransferOptions message. Also converts values to other types if specified. + * @param message TransferOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.TransferOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransferOptions { + + /** OverwriteWhen enum. */ + enum OverwriteWhen { + OVERWRITE_WHEN_UNSPECIFIED = 0, + DIFFERENT = 1, + NEVER = 2, + ALWAYS = 3 + } + } + + /** Properties of a TransferSpec. */ + interface ITransferSpec { + + /** TransferSpec gcsDataSink */ + gcsDataSink?: (google.storagetransfer.v1.IGcsData|null); + + /** TransferSpec posixDataSink */ + posixDataSink?: (google.storagetransfer.v1.IPosixFilesystem|null); + + /** TransferSpec gcsDataSource */ + gcsDataSource?: (google.storagetransfer.v1.IGcsData|null); + + /** TransferSpec awsS3DataSource */ + awsS3DataSource?: (google.storagetransfer.v1.IAwsS3Data|null); + + /** TransferSpec httpDataSource */ + httpDataSource?: (google.storagetransfer.v1.IHttpData|null); + + /** TransferSpec posixDataSource */ + posixDataSource?: (google.storagetransfer.v1.IPosixFilesystem|null); + + /** TransferSpec azureBlobStorageDataSource */ + azureBlobStorageDataSource?: (google.storagetransfer.v1.IAzureBlobStorageData|null); + + /** TransferSpec awsS3CompatibleDataSource */ + awsS3CompatibleDataSource?: (google.storagetransfer.v1.IAwsS3CompatibleData|null); + + /** TransferSpec gcsIntermediateDataLocation */ + gcsIntermediateDataLocation?: (google.storagetransfer.v1.IGcsData|null); + + /** TransferSpec objectConditions */ + objectConditions?: (google.storagetransfer.v1.IObjectConditions|null); + + /** TransferSpec transferOptions */ + transferOptions?: (google.storagetransfer.v1.ITransferOptions|null); + + /** TransferSpec transferManifest */ + transferManifest?: (google.storagetransfer.v1.ITransferManifest|null); + + /** TransferSpec sourceAgentPoolName */ + sourceAgentPoolName?: (string|null); + + /** TransferSpec sinkAgentPoolName */ + sinkAgentPoolName?: (string|null); + } + + /** Represents a TransferSpec. */ + class TransferSpec implements ITransferSpec { + + /** + * Constructs a new TransferSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ITransferSpec); + + /** TransferSpec gcsDataSink. */ + public gcsDataSink?: (google.storagetransfer.v1.IGcsData|null); + + /** TransferSpec posixDataSink. */ + public posixDataSink?: (google.storagetransfer.v1.IPosixFilesystem|null); + + /** TransferSpec gcsDataSource. */ + public gcsDataSource?: (google.storagetransfer.v1.IGcsData|null); + + /** TransferSpec awsS3DataSource. */ + public awsS3DataSource?: (google.storagetransfer.v1.IAwsS3Data|null); + + /** TransferSpec httpDataSource. */ + public httpDataSource?: (google.storagetransfer.v1.IHttpData|null); + + /** TransferSpec posixDataSource. */ + public posixDataSource?: (google.storagetransfer.v1.IPosixFilesystem|null); + + /** TransferSpec azureBlobStorageDataSource. */ + public azureBlobStorageDataSource?: (google.storagetransfer.v1.IAzureBlobStorageData|null); + + /** TransferSpec awsS3CompatibleDataSource. */ + public awsS3CompatibleDataSource?: (google.storagetransfer.v1.IAwsS3CompatibleData|null); + + /** TransferSpec gcsIntermediateDataLocation. */ + public gcsIntermediateDataLocation?: (google.storagetransfer.v1.IGcsData|null); + + /** TransferSpec objectConditions. */ + public objectConditions?: (google.storagetransfer.v1.IObjectConditions|null); + + /** TransferSpec transferOptions. */ + public transferOptions?: (google.storagetransfer.v1.ITransferOptions|null); + + /** TransferSpec transferManifest. */ + public transferManifest?: (google.storagetransfer.v1.ITransferManifest|null); + + /** TransferSpec sourceAgentPoolName. */ + public sourceAgentPoolName: string; + + /** TransferSpec sinkAgentPoolName. */ + public sinkAgentPoolName: string; + + /** TransferSpec dataSink. */ + public dataSink?: ("gcsDataSink"|"posixDataSink"); + + /** TransferSpec dataSource. */ + public dataSource?: ("gcsDataSource"|"awsS3DataSource"|"httpDataSource"|"posixDataSource"|"azureBlobStorageDataSource"|"awsS3CompatibleDataSource"); + + /** TransferSpec intermediateDataLocation. */ + public intermediateDataLocation?: "gcsIntermediateDataLocation"; + + /** + * Creates a new TransferSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferSpec instance + */ + public static create(properties?: google.storagetransfer.v1.ITransferSpec): google.storagetransfer.v1.TransferSpec; + + /** + * Encodes the specified TransferSpec message. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. + * @param message TransferSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ITransferSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferSpec message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. + * @param message TransferSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ITransferSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.TransferSpec; + + /** + * Decodes a TransferSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.TransferSpec; + + /** + * Verifies a TransferSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferSpec + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.TransferSpec; + + /** + * Creates a plain object from a TransferSpec message. Also converts values to other types if specified. + * @param message TransferSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.TransferSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetadataOptions. */ + interface IMetadataOptions { + + /** MetadataOptions symlink */ + symlink?: (google.storagetransfer.v1.MetadataOptions.Symlink|keyof typeof google.storagetransfer.v1.MetadataOptions.Symlink|null); + + /** MetadataOptions mode */ + mode?: (google.storagetransfer.v1.MetadataOptions.Mode|keyof typeof google.storagetransfer.v1.MetadataOptions.Mode|null); + + /** MetadataOptions gid */ + gid?: (google.storagetransfer.v1.MetadataOptions.GID|keyof typeof google.storagetransfer.v1.MetadataOptions.GID|null); + + /** MetadataOptions uid */ + uid?: (google.storagetransfer.v1.MetadataOptions.UID|keyof typeof google.storagetransfer.v1.MetadataOptions.UID|null); + + /** MetadataOptions acl */ + acl?: (google.storagetransfer.v1.MetadataOptions.Acl|keyof typeof google.storagetransfer.v1.MetadataOptions.Acl|null); + + /** MetadataOptions storageClass */ + storageClass?: (google.storagetransfer.v1.MetadataOptions.StorageClass|keyof typeof google.storagetransfer.v1.MetadataOptions.StorageClass|null); + + /** MetadataOptions temporaryHold */ + temporaryHold?: (google.storagetransfer.v1.MetadataOptions.TemporaryHold|keyof typeof google.storagetransfer.v1.MetadataOptions.TemporaryHold|null); + + /** MetadataOptions kmsKey */ + kmsKey?: (google.storagetransfer.v1.MetadataOptions.KmsKey|keyof typeof google.storagetransfer.v1.MetadataOptions.KmsKey|null); + + /** MetadataOptions timeCreated */ + timeCreated?: (google.storagetransfer.v1.MetadataOptions.TimeCreated|keyof typeof google.storagetransfer.v1.MetadataOptions.TimeCreated|null); + } + + /** Represents a MetadataOptions. */ + class MetadataOptions implements IMetadataOptions { + + /** + * Constructs a new MetadataOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IMetadataOptions); + + /** MetadataOptions symlink. */ + public symlink: (google.storagetransfer.v1.MetadataOptions.Symlink|keyof typeof google.storagetransfer.v1.MetadataOptions.Symlink); + + /** MetadataOptions mode. */ + public mode: (google.storagetransfer.v1.MetadataOptions.Mode|keyof typeof google.storagetransfer.v1.MetadataOptions.Mode); + + /** MetadataOptions gid. */ + public gid: (google.storagetransfer.v1.MetadataOptions.GID|keyof typeof google.storagetransfer.v1.MetadataOptions.GID); + + /** MetadataOptions uid. */ + public uid: (google.storagetransfer.v1.MetadataOptions.UID|keyof typeof google.storagetransfer.v1.MetadataOptions.UID); + + /** MetadataOptions acl. */ + public acl: (google.storagetransfer.v1.MetadataOptions.Acl|keyof typeof google.storagetransfer.v1.MetadataOptions.Acl); + + /** MetadataOptions storageClass. */ + public storageClass: (google.storagetransfer.v1.MetadataOptions.StorageClass|keyof typeof google.storagetransfer.v1.MetadataOptions.StorageClass); + + /** MetadataOptions temporaryHold. */ + public temporaryHold: (google.storagetransfer.v1.MetadataOptions.TemporaryHold|keyof typeof google.storagetransfer.v1.MetadataOptions.TemporaryHold); + + /** MetadataOptions kmsKey. */ + public kmsKey: (google.storagetransfer.v1.MetadataOptions.KmsKey|keyof typeof google.storagetransfer.v1.MetadataOptions.KmsKey); + + /** MetadataOptions timeCreated. */ + public timeCreated: (google.storagetransfer.v1.MetadataOptions.TimeCreated|keyof typeof google.storagetransfer.v1.MetadataOptions.TimeCreated); + + /** + * Creates a new MetadataOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataOptions instance + */ + public static create(properties?: google.storagetransfer.v1.IMetadataOptions): google.storagetransfer.v1.MetadataOptions; + + /** + * Encodes the specified MetadataOptions message. Does not implicitly {@link google.storagetransfer.v1.MetadataOptions.verify|verify} messages. + * @param message MetadataOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IMetadataOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataOptions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.MetadataOptions.verify|verify} messages. + * @param message MetadataOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IMetadataOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.MetadataOptions; + + /** + * Decodes a MetadataOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.MetadataOptions; + + /** + * Verifies a MetadataOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetadataOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataOptions + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.MetadataOptions; + + /** + * Creates a plain object from a MetadataOptions message. Also converts values to other types if specified. + * @param message MetadataOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.MetadataOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetadataOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MetadataOptions { + + /** Symlink enum. */ + enum Symlink { + SYMLINK_UNSPECIFIED = 0, + SYMLINK_SKIP = 1, + SYMLINK_PRESERVE = 2 + } + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + MODE_SKIP = 1, + MODE_PRESERVE = 2 + } + + /** GID enum. */ + enum GID { + GID_UNSPECIFIED = 0, + GID_SKIP = 1, + GID_NUMBER = 2 + } + + /** UID enum. */ + enum UID { + UID_UNSPECIFIED = 0, + UID_SKIP = 1, + UID_NUMBER = 2 + } + + /** Acl enum. */ + enum Acl { + ACL_UNSPECIFIED = 0, + ACL_DESTINATION_BUCKET_DEFAULT = 1, + ACL_PRESERVE = 2 + } + + /** StorageClass enum. */ + enum StorageClass { + STORAGE_CLASS_UNSPECIFIED = 0, + STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT = 1, + STORAGE_CLASS_PRESERVE = 2, + STORAGE_CLASS_STANDARD = 3, + STORAGE_CLASS_NEARLINE = 4, + STORAGE_CLASS_COLDLINE = 5, + STORAGE_CLASS_ARCHIVE = 6 + } + + /** TemporaryHold enum. */ + enum TemporaryHold { + TEMPORARY_HOLD_UNSPECIFIED = 0, + TEMPORARY_HOLD_SKIP = 1, + TEMPORARY_HOLD_PRESERVE = 2 + } + + /** KmsKey enum. */ + enum KmsKey { + KMS_KEY_UNSPECIFIED = 0, + KMS_KEY_DESTINATION_BUCKET_DEFAULT = 1, + KMS_KEY_PRESERVE = 2 + } + + /** TimeCreated enum. */ + enum TimeCreated { + TIME_CREATED_UNSPECIFIED = 0, + TIME_CREATED_SKIP = 1, + TIME_CREATED_PRESERVE_AS_CUSTOM_TIME = 2 + } + } + + /** Properties of a TransferManifest. */ + interface ITransferManifest { + + /** TransferManifest location */ + location?: (string|null); + } + + /** Represents a TransferManifest. */ + class TransferManifest implements ITransferManifest { + + /** + * Constructs a new TransferManifest. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ITransferManifest); + + /** TransferManifest location. */ + public location: string; + + /** + * Creates a new TransferManifest instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferManifest instance + */ + public static create(properties?: google.storagetransfer.v1.ITransferManifest): google.storagetransfer.v1.TransferManifest; + + /** + * Encodes the specified TransferManifest message. Does not implicitly {@link google.storagetransfer.v1.TransferManifest.verify|verify} messages. + * @param message TransferManifest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ITransferManifest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferManifest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferManifest.verify|verify} messages. + * @param message TransferManifest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ITransferManifest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferManifest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferManifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.TransferManifest; + + /** + * Decodes a TransferManifest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferManifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.TransferManifest; + + /** + * Verifies a TransferManifest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferManifest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferManifest + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.TransferManifest; + + /** + * Creates a plain object from a TransferManifest message. Also converts values to other types if specified. + * @param message TransferManifest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.TransferManifest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferManifest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferManifest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Schedule. */ + interface ISchedule { + + /** Schedule scheduleStartDate */ + scheduleStartDate?: (google.type.IDate|null); + + /** Schedule scheduleEndDate */ + scheduleEndDate?: (google.type.IDate|null); + + /** Schedule startTimeOfDay */ + startTimeOfDay?: (google.type.ITimeOfDay|null); + + /** Schedule endTimeOfDay */ + endTimeOfDay?: (google.type.ITimeOfDay|null); + + /** Schedule repeatInterval */ + repeatInterval?: (google.protobuf.IDuration|null); + } + + /** Represents a Schedule. */ + class Schedule implements ISchedule { + + /** + * Constructs a new Schedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ISchedule); + + /** Schedule scheduleStartDate. */ + public scheduleStartDate?: (google.type.IDate|null); + + /** Schedule scheduleEndDate. */ + public scheduleEndDate?: (google.type.IDate|null); + + /** Schedule startTimeOfDay. */ + public startTimeOfDay?: (google.type.ITimeOfDay|null); + + /** Schedule endTimeOfDay. */ + public endTimeOfDay?: (google.type.ITimeOfDay|null); + + /** Schedule repeatInterval. */ + public repeatInterval?: (google.protobuf.IDuration|null); + + /** + * Creates a new Schedule instance using the specified properties. + * @param [properties] Properties to set + * @returns Schedule instance + */ + public static create(properties?: google.storagetransfer.v1.ISchedule): google.storagetransfer.v1.Schedule; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.storagetransfer.v1.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.storagetransfer.v1.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.Schedule; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.Schedule; + + /** + * Verifies a Schedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schedule + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.Schedule; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @param message Schedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.Schedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferJob. */ + interface ITransferJob { + + /** TransferJob name */ + name?: (string|null); + + /** TransferJob description */ + description?: (string|null); + + /** TransferJob projectId */ + projectId?: (string|null); + + /** TransferJob transferSpec */ + transferSpec?: (google.storagetransfer.v1.ITransferSpec|null); + + /** TransferJob notificationConfig */ + notificationConfig?: (google.storagetransfer.v1.INotificationConfig|null); + + /** TransferJob loggingConfig */ + loggingConfig?: (google.storagetransfer.v1.ILoggingConfig|null); + + /** TransferJob schedule */ + schedule?: (google.storagetransfer.v1.ISchedule|null); + + /** TransferJob status */ + status?: (google.storagetransfer.v1.TransferJob.Status|keyof typeof google.storagetransfer.v1.TransferJob.Status|null); + + /** TransferJob creationTime */ + creationTime?: (google.protobuf.ITimestamp|null); + + /** TransferJob lastModificationTime */ + lastModificationTime?: (google.protobuf.ITimestamp|null); + + /** TransferJob deletionTime */ + deletionTime?: (google.protobuf.ITimestamp|null); + + /** TransferJob latestOperationName */ + latestOperationName?: (string|null); + } + + /** Represents a TransferJob. */ + class TransferJob implements ITransferJob { + + /** + * Constructs a new TransferJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ITransferJob); + + /** TransferJob name. */ + public name: string; + + /** TransferJob description. */ + public description: string; + + /** TransferJob projectId. */ + public projectId: string; + + /** TransferJob transferSpec. */ + public transferSpec?: (google.storagetransfer.v1.ITransferSpec|null); + + /** TransferJob notificationConfig. */ + public notificationConfig?: (google.storagetransfer.v1.INotificationConfig|null); + + /** TransferJob loggingConfig. */ + public loggingConfig?: (google.storagetransfer.v1.ILoggingConfig|null); + + /** TransferJob schedule. */ + public schedule?: (google.storagetransfer.v1.ISchedule|null); + + /** TransferJob status. */ + public status: (google.storagetransfer.v1.TransferJob.Status|keyof typeof google.storagetransfer.v1.TransferJob.Status); + + /** TransferJob creationTime. */ + public creationTime?: (google.protobuf.ITimestamp|null); + + /** TransferJob lastModificationTime. */ + public lastModificationTime?: (google.protobuf.ITimestamp|null); + + /** TransferJob deletionTime. */ + public deletionTime?: (google.protobuf.ITimestamp|null); + + /** TransferJob latestOperationName. */ + public latestOperationName: string; + + /** + * Creates a new TransferJob instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferJob instance + */ + public static create(properties?: google.storagetransfer.v1.ITransferJob): google.storagetransfer.v1.TransferJob; + + /** + * Encodes the specified TransferJob message. Does not implicitly {@link google.storagetransfer.v1.TransferJob.verify|verify} messages. + * @param message TransferJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ITransferJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferJob message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferJob.verify|verify} messages. + * @param message TransferJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ITransferJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.TransferJob; + + /** + * Decodes a TransferJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.TransferJob; + + /** + * Verifies a TransferJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferJob + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.TransferJob; + + /** + * Creates a plain object from a TransferJob message. Also converts values to other types if specified. + * @param message TransferJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.TransferJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransferJob { + + /** Status enum. */ + enum Status { + STATUS_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2, + DELETED = 3 + } + } + + /** Properties of an ErrorLogEntry. */ + interface IErrorLogEntry { + + /** ErrorLogEntry url */ + url?: (string|null); + + /** ErrorLogEntry errorDetails */ + errorDetails?: (string[]|null); + } + + /** Represents an ErrorLogEntry. */ + class ErrorLogEntry implements IErrorLogEntry { + + /** + * Constructs a new ErrorLogEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IErrorLogEntry); + + /** ErrorLogEntry url. */ + public url: string; + + /** ErrorLogEntry errorDetails. */ + public errorDetails: string[]; + + /** + * Creates a new ErrorLogEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ErrorLogEntry instance + */ + public static create(properties?: google.storagetransfer.v1.IErrorLogEntry): google.storagetransfer.v1.ErrorLogEntry; + + /** + * Encodes the specified ErrorLogEntry message. Does not implicitly {@link google.storagetransfer.v1.ErrorLogEntry.verify|verify} messages. + * @param message ErrorLogEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IErrorLogEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ErrorLogEntry message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ErrorLogEntry.verify|verify} messages. + * @param message ErrorLogEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IErrorLogEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ErrorLogEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ErrorLogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.ErrorLogEntry; + + /** + * Decodes an ErrorLogEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ErrorLogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.ErrorLogEntry; + + /** + * Verifies an ErrorLogEntry message. + * @param message Plain 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 ErrorLogEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ErrorLogEntry + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ErrorLogEntry; + + /** + * Creates a plain object from an ErrorLogEntry message. Also converts values to other types if specified. + * @param message ErrorLogEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.ErrorLogEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ErrorLogEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ErrorLogEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ErrorSummary. */ + interface IErrorSummary { + + /** ErrorSummary errorCode */ + errorCode?: (google.rpc.Code|keyof typeof google.rpc.Code|null); + + /** ErrorSummary errorCount */ + errorCount?: (number|Long|string|null); + + /** ErrorSummary errorLogEntries */ + errorLogEntries?: (google.storagetransfer.v1.IErrorLogEntry[]|null); + } + + /** Represents an ErrorSummary. */ + class ErrorSummary implements IErrorSummary { + + /** + * Constructs a new ErrorSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.IErrorSummary); + + /** ErrorSummary errorCode. */ + public errorCode: (google.rpc.Code|keyof typeof google.rpc.Code); + + /** ErrorSummary errorCount. */ + public errorCount: (number|Long|string); + + /** ErrorSummary errorLogEntries. */ + public errorLogEntries: google.storagetransfer.v1.IErrorLogEntry[]; + + /** + * Creates a new ErrorSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns ErrorSummary instance + */ + public static create(properties?: google.storagetransfer.v1.IErrorSummary): google.storagetransfer.v1.ErrorSummary; + + /** + * Encodes the specified ErrorSummary message. Does not implicitly {@link google.storagetransfer.v1.ErrorSummary.verify|verify} messages. + * @param message ErrorSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.IErrorSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ErrorSummary message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ErrorSummary.verify|verify} messages. + * @param message ErrorSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.IErrorSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ErrorSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ErrorSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.ErrorSummary; + + /** + * Decodes an ErrorSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ErrorSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.ErrorSummary; + + /** + * Verifies an ErrorSummary message. + * @param message Plain 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 ErrorSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ErrorSummary + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.ErrorSummary; + + /** + * Creates a plain object from an ErrorSummary message. Also converts values to other types if specified. + * @param message ErrorSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.ErrorSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ErrorSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ErrorSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferCounters. */ + interface ITransferCounters { + + /** TransferCounters objectsFoundFromSource */ + objectsFoundFromSource?: (number|Long|string|null); + + /** TransferCounters bytesFoundFromSource */ + bytesFoundFromSource?: (number|Long|string|null); + + /** TransferCounters objectsFoundOnlyFromSink */ + objectsFoundOnlyFromSink?: (number|Long|string|null); + + /** TransferCounters bytesFoundOnlyFromSink */ + bytesFoundOnlyFromSink?: (number|Long|string|null); + + /** TransferCounters objectsFromSourceSkippedBySync */ + objectsFromSourceSkippedBySync?: (number|Long|string|null); + + /** TransferCounters bytesFromSourceSkippedBySync */ + bytesFromSourceSkippedBySync?: (number|Long|string|null); + + /** TransferCounters objectsCopiedToSink */ + objectsCopiedToSink?: (number|Long|string|null); + + /** TransferCounters bytesCopiedToSink */ + bytesCopiedToSink?: (number|Long|string|null); + + /** TransferCounters objectsDeletedFromSource */ + objectsDeletedFromSource?: (number|Long|string|null); + + /** TransferCounters bytesDeletedFromSource */ + bytesDeletedFromSource?: (number|Long|string|null); + + /** TransferCounters objectsDeletedFromSink */ + objectsDeletedFromSink?: (number|Long|string|null); + + /** TransferCounters bytesDeletedFromSink */ + bytesDeletedFromSink?: (number|Long|string|null); + + /** TransferCounters objectsFromSourceFailed */ + objectsFromSourceFailed?: (number|Long|string|null); + + /** TransferCounters bytesFromSourceFailed */ + bytesFromSourceFailed?: (number|Long|string|null); + + /** TransferCounters objectsFailedToDeleteFromSink */ + objectsFailedToDeleteFromSink?: (number|Long|string|null); + + /** TransferCounters bytesFailedToDeleteFromSink */ + bytesFailedToDeleteFromSink?: (number|Long|string|null); + + /** TransferCounters directoriesFoundFromSource */ + directoriesFoundFromSource?: (number|Long|string|null); + + /** TransferCounters directoriesFailedToListFromSource */ + directoriesFailedToListFromSource?: (number|Long|string|null); + + /** TransferCounters directoriesSuccessfullyListedFromSource */ + directoriesSuccessfullyListedFromSource?: (number|Long|string|null); + + /** TransferCounters intermediateObjectsCleanedUp */ + intermediateObjectsCleanedUp?: (number|Long|string|null); + + /** TransferCounters intermediateObjectsFailedCleanedUp */ + intermediateObjectsFailedCleanedUp?: (number|Long|string|null); + } + + /** Represents a TransferCounters. */ + class TransferCounters implements ITransferCounters { + + /** + * Constructs a new TransferCounters. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ITransferCounters); + + /** TransferCounters objectsFoundFromSource. */ + public objectsFoundFromSource: (number|Long|string); + + /** TransferCounters bytesFoundFromSource. */ + public bytesFoundFromSource: (number|Long|string); + + /** TransferCounters objectsFoundOnlyFromSink. */ + public objectsFoundOnlyFromSink: (number|Long|string); + + /** TransferCounters bytesFoundOnlyFromSink. */ + public bytesFoundOnlyFromSink: (number|Long|string); + + /** TransferCounters objectsFromSourceSkippedBySync. */ + public objectsFromSourceSkippedBySync: (number|Long|string); + + /** TransferCounters bytesFromSourceSkippedBySync. */ + public bytesFromSourceSkippedBySync: (number|Long|string); + + /** TransferCounters objectsCopiedToSink. */ + public objectsCopiedToSink: (number|Long|string); + + /** TransferCounters bytesCopiedToSink. */ + public bytesCopiedToSink: (number|Long|string); + + /** TransferCounters objectsDeletedFromSource. */ + public objectsDeletedFromSource: (number|Long|string); + + /** TransferCounters bytesDeletedFromSource. */ + public bytesDeletedFromSource: (number|Long|string); + + /** TransferCounters objectsDeletedFromSink. */ + public objectsDeletedFromSink: (number|Long|string); + + /** TransferCounters bytesDeletedFromSink. */ + public bytesDeletedFromSink: (number|Long|string); + + /** TransferCounters objectsFromSourceFailed. */ + public objectsFromSourceFailed: (number|Long|string); + + /** TransferCounters bytesFromSourceFailed. */ + public bytesFromSourceFailed: (number|Long|string); + + /** TransferCounters objectsFailedToDeleteFromSink. */ + public objectsFailedToDeleteFromSink: (number|Long|string); + + /** TransferCounters bytesFailedToDeleteFromSink. */ + public bytesFailedToDeleteFromSink: (number|Long|string); + + /** TransferCounters directoriesFoundFromSource. */ + public directoriesFoundFromSource: (number|Long|string); + + /** TransferCounters directoriesFailedToListFromSource. */ + public directoriesFailedToListFromSource: (number|Long|string); + + /** TransferCounters directoriesSuccessfullyListedFromSource. */ + public directoriesSuccessfullyListedFromSource: (number|Long|string); + + /** TransferCounters intermediateObjectsCleanedUp. */ + public intermediateObjectsCleanedUp: (number|Long|string); + + /** TransferCounters intermediateObjectsFailedCleanedUp. */ + public intermediateObjectsFailedCleanedUp: (number|Long|string); + + /** + * Creates a new TransferCounters instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferCounters instance + */ + public static create(properties?: google.storagetransfer.v1.ITransferCounters): google.storagetransfer.v1.TransferCounters; + + /** + * Encodes the specified TransferCounters message. Does not implicitly {@link google.storagetransfer.v1.TransferCounters.verify|verify} messages. + * @param message TransferCounters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ITransferCounters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferCounters message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferCounters.verify|verify} messages. + * @param message TransferCounters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ITransferCounters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferCounters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferCounters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.TransferCounters; + + /** + * Decodes a TransferCounters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferCounters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.TransferCounters; + + /** + * Verifies a TransferCounters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferCounters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferCounters + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.TransferCounters; + + /** + * Creates a plain object from a TransferCounters message. Also converts values to other types if specified. + * @param message TransferCounters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.TransferCounters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferCounters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferCounters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NotificationConfig. */ + interface INotificationConfig { + + /** NotificationConfig pubsubTopic */ + pubsubTopic?: (string|null); + + /** NotificationConfig eventTypes */ + eventTypes?: (google.storagetransfer.v1.NotificationConfig.EventType[]|null); + + /** NotificationConfig payloadFormat */ + payloadFormat?: (google.storagetransfer.v1.NotificationConfig.PayloadFormat|keyof typeof google.storagetransfer.v1.NotificationConfig.PayloadFormat|null); + } + + /** Represents a NotificationConfig. */ + class NotificationConfig implements INotificationConfig { + + /** + * Constructs a new NotificationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.INotificationConfig); + + /** NotificationConfig pubsubTopic. */ + public pubsubTopic: string; + + /** NotificationConfig eventTypes. */ + public eventTypes: google.storagetransfer.v1.NotificationConfig.EventType[]; + + /** NotificationConfig payloadFormat. */ + public payloadFormat: (google.storagetransfer.v1.NotificationConfig.PayloadFormat|keyof typeof google.storagetransfer.v1.NotificationConfig.PayloadFormat); + + /** + * Creates a new NotificationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationConfig instance + */ + public static create(properties?: google.storagetransfer.v1.INotificationConfig): google.storagetransfer.v1.NotificationConfig; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.storagetransfer.v1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.storagetransfer.v1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.NotificationConfig; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.NotificationConfig; + + /** + * Verifies a NotificationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationConfig + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.NotificationConfig; + + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @param message NotificationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.NotificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotificationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NotificationConfig { + + /** EventType enum. */ + enum EventType { + EVENT_TYPE_UNSPECIFIED = 0, + TRANSFER_OPERATION_SUCCESS = 1, + TRANSFER_OPERATION_FAILED = 2, + TRANSFER_OPERATION_ABORTED = 3 + } + + /** PayloadFormat enum. */ + enum PayloadFormat { + PAYLOAD_FORMAT_UNSPECIFIED = 0, + NONE = 1, + JSON = 2 + } + } + + /** Properties of a LoggingConfig. */ + interface ILoggingConfig { + + /** LoggingConfig logActions */ + logActions?: (google.storagetransfer.v1.LoggingConfig.LoggableAction[]|null); + + /** LoggingConfig logActionStates */ + logActionStates?: (google.storagetransfer.v1.LoggingConfig.LoggableActionState[]|null); + + /** LoggingConfig enableOnpremGcsTransferLogs */ + enableOnpremGcsTransferLogs?: (boolean|null); + } + + /** Represents a LoggingConfig. */ + class LoggingConfig implements ILoggingConfig { + + /** + * Constructs a new LoggingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ILoggingConfig); + + /** LoggingConfig logActions. */ + public logActions: google.storagetransfer.v1.LoggingConfig.LoggableAction[]; + + /** LoggingConfig logActionStates. */ + public logActionStates: google.storagetransfer.v1.LoggingConfig.LoggableActionState[]; + + /** LoggingConfig enableOnpremGcsTransferLogs. */ + public enableOnpremGcsTransferLogs: boolean; + + /** + * Creates a new LoggingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LoggingConfig instance + */ + public static create(properties?: google.storagetransfer.v1.ILoggingConfig): google.storagetransfer.v1.LoggingConfig; + + /** + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.storagetransfer.v1.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.storagetransfer.v1.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.LoggingConfig; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.LoggingConfig; + + /** + * Verifies a LoggingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoggingConfig + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.LoggingConfig; + + /** + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. + * @param message LoggingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.LoggingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoggingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoggingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LoggingConfig { + + /** LoggableAction enum. */ + enum LoggableAction { + LOGGABLE_ACTION_UNSPECIFIED = 0, + FIND = 1, + DELETE = 2, + COPY = 3 + } + + /** LoggableActionState enum. */ + enum LoggableActionState { + LOGGABLE_ACTION_STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2 + } + } + + /** Properties of a TransferOperation. */ + interface ITransferOperation { + + /** TransferOperation name */ + name?: (string|null); + + /** TransferOperation projectId */ + projectId?: (string|null); + + /** TransferOperation transferSpec */ + transferSpec?: (google.storagetransfer.v1.ITransferSpec|null); + + /** TransferOperation notificationConfig */ + notificationConfig?: (google.storagetransfer.v1.INotificationConfig|null); + + /** TransferOperation startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TransferOperation endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** TransferOperation status */ + status?: (google.storagetransfer.v1.TransferOperation.Status|keyof typeof google.storagetransfer.v1.TransferOperation.Status|null); + + /** TransferOperation counters */ + counters?: (google.storagetransfer.v1.ITransferCounters|null); + + /** TransferOperation errorBreakdowns */ + errorBreakdowns?: (google.storagetransfer.v1.IErrorSummary[]|null); + + /** TransferOperation transferJobName */ + transferJobName?: (string|null); + } + + /** Represents a TransferOperation. */ + class TransferOperation implements ITransferOperation { + + /** + * Constructs a new TransferOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.storagetransfer.v1.ITransferOperation); + + /** TransferOperation name. */ + public name: string; + + /** TransferOperation projectId. */ + public projectId: string; + + /** TransferOperation transferSpec. */ + public transferSpec?: (google.storagetransfer.v1.ITransferSpec|null); + + /** TransferOperation notificationConfig. */ + public notificationConfig?: (google.storagetransfer.v1.INotificationConfig|null); + + /** TransferOperation startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TransferOperation endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** TransferOperation status. */ + public status: (google.storagetransfer.v1.TransferOperation.Status|keyof typeof google.storagetransfer.v1.TransferOperation.Status); + + /** TransferOperation counters. */ + public counters?: (google.storagetransfer.v1.ITransferCounters|null); + + /** TransferOperation errorBreakdowns. */ + public errorBreakdowns: google.storagetransfer.v1.IErrorSummary[]; + + /** TransferOperation transferJobName. */ + public transferJobName: string; + + /** + * Creates a new TransferOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferOperation instance + */ + public static create(properties?: google.storagetransfer.v1.ITransferOperation): google.storagetransfer.v1.TransferOperation; + + /** + * Encodes the specified TransferOperation message. Does not implicitly {@link google.storagetransfer.v1.TransferOperation.verify|verify} messages. + * @param message TransferOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.storagetransfer.v1.ITransferOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferOperation message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferOperation.verify|verify} messages. + * @param message TransferOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.storagetransfer.v1.ITransferOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.storagetransfer.v1.TransferOperation; + + /** + * Decodes a TransferOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.storagetransfer.v1.TransferOperation; + + /** + * Verifies a TransferOperation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferOperation + */ + public static fromObject(object: { [k: string]: any }): google.storagetransfer.v1.TransferOperation; + + /** + * Creates a plain object from a TransferOperation message. Also converts values to other types if specified. + * @param message TransferOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.storagetransfer.v1.TransferOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransferOperation { + + /** Status enum. */ + enum Status { + STATUS_UNSPECIFIED = 0, + IN_PROGRESS = 1, + PAUSED = 2, + SUCCESS = 3, + FAILED = 4, + ABORTED = 5, + QUEUED = 6 + } + } + } + } + + /** 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); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Code enum. */ + enum Code { + OK = 0, + CANCELLED = 1, + UNKNOWN = 2, + INVALID_ARGUMENT = 3, + DEADLINE_EXCEEDED = 4, + NOT_FOUND = 5, + ALREADY_EXISTS = 6, + PERMISSION_DENIED = 7, + UNAUTHENTICATED = 16, + RESOURCE_EXHAUSTED = 8, + FAILED_PRECONDITION = 9, + ABORTED = 10, + OUT_OF_RANGE = 11, + UNIMPLEMENTED = 12, + INTERNAL = 13, + UNAVAILABLE = 14, + DATA_LOSS = 15 + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeOfDay. */ + interface ITimeOfDay { + + /** TimeOfDay hours */ + hours?: (number|null); + + /** TimeOfDay minutes */ + minutes?: (number|null); + + /** TimeOfDay seconds */ + seconds?: (number|null); + + /** TimeOfDay nanos */ + nanos?: (number|null); + } + + /** Represents a TimeOfDay. */ + class TimeOfDay implements ITimeOfDay { + + /** + * Constructs a new TimeOfDay. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeOfDay); + + /** TimeOfDay hours. */ + public hours: number; + + /** TimeOfDay minutes. */ + public minutes: number; + + /** TimeOfDay seconds. */ + public seconds: number; + + /** TimeOfDay nanos. */ + public nanos: number; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeOfDay instance + */ + public static create(properties?: google.type.ITimeOfDay): google.type.TimeOfDay; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.TimeOfDay; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.TimeOfDay; + + /** + * Verifies a TimeOfDay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeOfDay + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeOfDay; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @param message TimeOfDay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeOfDay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeOfDay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeOfDay + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-storagetransfer/protos/protos.js b/packages/google-storagetransfer/protos/protos.js new file mode 100644 index 00000000000..47e177a2a41 --- /dev/null +++ b/packages/google-storagetransfer/protos/protos.js @@ -0,0 +1,28690 @@ +// 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_storage_transfer_protos || ($protobuf.roots._google_cloud_storage_transfer_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.storagetransfer = (function() { + + /** + * Namespace storagetransfer. + * @memberof google + * @namespace + */ + var storagetransfer = {}; + + storagetransfer.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.storagetransfer + * @namespace + */ + var v1 = {}; + + v1.StorageTransferService = (function() { + + /** + * Constructs a new StorageTransferService service. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a StorageTransferService + * @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 StorageTransferService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (StorageTransferService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = StorageTransferService; + + /** + * Creates new StorageTransferService service using the specified rpc implementation. + * @function create + * @memberof google.storagetransfer.v1.StorageTransferService + * @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 {StorageTransferService} RPC service. Useful where requests and/or responses are streamed. + */ + StorageTransferService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|getGoogleServiceAccount}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef GetGoogleServiceAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.GoogleServiceAccount} [response] GoogleServiceAccount + */ + + /** + * Calls GetGoogleServiceAccount. + * @function getGoogleServiceAccount + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IGetGoogleServiceAccountRequest} request GetGoogleServiceAccountRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.GetGoogleServiceAccountCallback} callback Node-style callback called with the error, if any, and GoogleServiceAccount + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.getGoogleServiceAccount = function getGoogleServiceAccount(request, callback) { + return this.rpcCall(getGoogleServiceAccount, $root.google.storagetransfer.v1.GetGoogleServiceAccountRequest, $root.google.storagetransfer.v1.GoogleServiceAccount, request, callback); + }, "name", { value: "GetGoogleServiceAccount" }); + + /** + * Calls GetGoogleServiceAccount. + * @function getGoogleServiceAccount + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IGetGoogleServiceAccountRequest} request GetGoogleServiceAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|createTransferJob}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef CreateTransferJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.TransferJob} [response] TransferJob + */ + + /** + * Calls CreateTransferJob. + * @function createTransferJob + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.ICreateTransferJobRequest} request CreateTransferJobRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.CreateTransferJobCallback} callback Node-style callback called with the error, if any, and TransferJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.createTransferJob = function createTransferJob(request, callback) { + return this.rpcCall(createTransferJob, $root.google.storagetransfer.v1.CreateTransferJobRequest, $root.google.storagetransfer.v1.TransferJob, request, callback); + }, "name", { value: "CreateTransferJob" }); + + /** + * Calls CreateTransferJob. + * @function createTransferJob + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.ICreateTransferJobRequest} request CreateTransferJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|updateTransferJob}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef UpdateTransferJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.TransferJob} [response] TransferJob + */ + + /** + * Calls UpdateTransferJob. + * @function updateTransferJob + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IUpdateTransferJobRequest} request UpdateTransferJobRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.UpdateTransferJobCallback} callback Node-style callback called with the error, if any, and TransferJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.updateTransferJob = function updateTransferJob(request, callback) { + return this.rpcCall(updateTransferJob, $root.google.storagetransfer.v1.UpdateTransferJobRequest, $root.google.storagetransfer.v1.TransferJob, request, callback); + }, "name", { value: "UpdateTransferJob" }); + + /** + * Calls UpdateTransferJob. + * @function updateTransferJob + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IUpdateTransferJobRequest} request UpdateTransferJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|getTransferJob}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef GetTransferJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.TransferJob} [response] TransferJob + */ + + /** + * Calls GetTransferJob. + * @function getTransferJob + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IGetTransferJobRequest} request GetTransferJobRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.GetTransferJobCallback} callback Node-style callback called with the error, if any, and TransferJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.getTransferJob = function getTransferJob(request, callback) { + return this.rpcCall(getTransferJob, $root.google.storagetransfer.v1.GetTransferJobRequest, $root.google.storagetransfer.v1.TransferJob, request, callback); + }, "name", { value: "GetTransferJob" }); + + /** + * Calls GetTransferJob. + * @function getTransferJob + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IGetTransferJobRequest} request GetTransferJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|listTransferJobs}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef ListTransferJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.ListTransferJobsResponse} [response] ListTransferJobsResponse + */ + + /** + * Calls ListTransferJobs. + * @function listTransferJobs + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IListTransferJobsRequest} request ListTransferJobsRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.ListTransferJobsCallback} callback Node-style callback called with the error, if any, and ListTransferJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.listTransferJobs = function listTransferJobs(request, callback) { + return this.rpcCall(listTransferJobs, $root.google.storagetransfer.v1.ListTransferJobsRequest, $root.google.storagetransfer.v1.ListTransferJobsResponse, request, callback); + }, "name", { value: "ListTransferJobs" }); + + /** + * Calls ListTransferJobs. + * @function listTransferJobs + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IListTransferJobsRequest} request ListTransferJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|pauseTransferOperation}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef PauseTransferOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls PauseTransferOperation. + * @function pauseTransferOperation + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IPauseTransferOperationRequest} request PauseTransferOperationRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.PauseTransferOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.pauseTransferOperation = function pauseTransferOperation(request, callback) { + return this.rpcCall(pauseTransferOperation, $root.google.storagetransfer.v1.PauseTransferOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "PauseTransferOperation" }); + + /** + * Calls PauseTransferOperation. + * @function pauseTransferOperation + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IPauseTransferOperationRequest} request PauseTransferOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|resumeTransferOperation}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef ResumeTransferOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls ResumeTransferOperation. + * @function resumeTransferOperation + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IResumeTransferOperationRequest} request ResumeTransferOperationRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.ResumeTransferOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.resumeTransferOperation = function resumeTransferOperation(request, callback) { + return this.rpcCall(resumeTransferOperation, $root.google.storagetransfer.v1.ResumeTransferOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "ResumeTransferOperation" }); + + /** + * Calls ResumeTransferOperation. + * @function resumeTransferOperation + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IResumeTransferOperationRequest} request ResumeTransferOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|runTransferJob}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef RunTransferJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunTransferJob. + * @function runTransferJob + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IRunTransferJobRequest} request RunTransferJobRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.RunTransferJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.runTransferJob = function runTransferJob(request, callback) { + return this.rpcCall(runTransferJob, $root.google.storagetransfer.v1.RunTransferJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunTransferJob" }); + + /** + * Calls RunTransferJob. + * @function runTransferJob + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IRunTransferJobRequest} request RunTransferJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|deleteTransferJob}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef DeleteTransferJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTransferJob. + * @function deleteTransferJob + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IDeleteTransferJobRequest} request DeleteTransferJobRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.DeleteTransferJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.deleteTransferJob = function deleteTransferJob(request, callback) { + return this.rpcCall(deleteTransferJob, $root.google.storagetransfer.v1.DeleteTransferJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTransferJob" }); + + /** + * Calls DeleteTransferJob. + * @function deleteTransferJob + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IDeleteTransferJobRequest} request DeleteTransferJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|createAgentPool}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef CreateAgentPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.AgentPool} [response] AgentPool + */ + + /** + * Calls CreateAgentPool. + * @function createAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest} request CreateAgentPoolRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.CreateAgentPoolCallback} callback Node-style callback called with the error, if any, and AgentPool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.createAgentPool = function createAgentPool(request, callback) { + return this.rpcCall(createAgentPool, $root.google.storagetransfer.v1.CreateAgentPoolRequest, $root.google.storagetransfer.v1.AgentPool, request, callback); + }, "name", { value: "CreateAgentPool" }); + + /** + * Calls CreateAgentPool. + * @function createAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest} request CreateAgentPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|updateAgentPool}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef UpdateAgentPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.AgentPool} [response] AgentPool + */ + + /** + * Calls UpdateAgentPool. + * @function updateAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest} request UpdateAgentPoolRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.UpdateAgentPoolCallback} callback Node-style callback called with the error, if any, and AgentPool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.updateAgentPool = function updateAgentPool(request, callback) { + return this.rpcCall(updateAgentPool, $root.google.storagetransfer.v1.UpdateAgentPoolRequest, $root.google.storagetransfer.v1.AgentPool, request, callback); + }, "name", { value: "UpdateAgentPool" }); + + /** + * Calls UpdateAgentPool. + * @function updateAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest} request UpdateAgentPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|getAgentPool}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef GetAgentPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.AgentPool} [response] AgentPool + */ + + /** + * Calls GetAgentPool. + * @function getAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IGetAgentPoolRequest} request GetAgentPoolRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.GetAgentPoolCallback} callback Node-style callback called with the error, if any, and AgentPool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.getAgentPool = function getAgentPool(request, callback) { + return this.rpcCall(getAgentPool, $root.google.storagetransfer.v1.GetAgentPoolRequest, $root.google.storagetransfer.v1.AgentPool, request, callback); + }, "name", { value: "GetAgentPool" }); + + /** + * Calls GetAgentPool. + * @function getAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IGetAgentPoolRequest} request GetAgentPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|listAgentPools}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef ListAgentPoolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.storagetransfer.v1.ListAgentPoolsResponse} [response] ListAgentPoolsResponse + */ + + /** + * Calls ListAgentPools. + * @function listAgentPools + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IListAgentPoolsRequest} request ListAgentPoolsRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.ListAgentPoolsCallback} callback Node-style callback called with the error, if any, and ListAgentPoolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.listAgentPools = function listAgentPools(request, callback) { + return this.rpcCall(listAgentPools, $root.google.storagetransfer.v1.ListAgentPoolsRequest, $root.google.storagetransfer.v1.ListAgentPoolsResponse, request, callback); + }, "name", { value: "ListAgentPools" }); + + /** + * Calls ListAgentPools. + * @function listAgentPools + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IListAgentPoolsRequest} request ListAgentPoolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.storagetransfer.v1.StorageTransferService|deleteAgentPool}. + * @memberof google.storagetransfer.v1.StorageTransferService + * @typedef DeleteAgentPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAgentPool. + * @function deleteAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest} request DeleteAgentPoolRequest message or plain object + * @param {google.storagetransfer.v1.StorageTransferService.DeleteAgentPoolCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StorageTransferService.prototype.deleteAgentPool = function deleteAgentPool(request, callback) { + return this.rpcCall(deleteAgentPool, $root.google.storagetransfer.v1.DeleteAgentPoolRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAgentPool" }); + + /** + * Calls DeleteAgentPool. + * @function deleteAgentPool + * @memberof google.storagetransfer.v1.StorageTransferService + * @instance + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest} request DeleteAgentPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return StorageTransferService; + })(); + + v1.GetGoogleServiceAccountRequest = (function() { + + /** + * Properties of a GetGoogleServiceAccountRequest. + * @memberof google.storagetransfer.v1 + * @interface IGetGoogleServiceAccountRequest + * @property {string|null} [projectId] GetGoogleServiceAccountRequest projectId + */ + + /** + * Constructs a new GetGoogleServiceAccountRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a GetGoogleServiceAccountRequest. + * @implements IGetGoogleServiceAccountRequest + * @constructor + * @param {google.storagetransfer.v1.IGetGoogleServiceAccountRequest=} [properties] Properties to set + */ + function GetGoogleServiceAccountRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGoogleServiceAccountRequest projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.GetGoogleServiceAccountRequest + * @instance + */ + GetGoogleServiceAccountRequest.prototype.projectId = ""; + + /** + * Creates a new GetGoogleServiceAccountRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.GetGoogleServiceAccountRequest + * @static + * @param {google.storagetransfer.v1.IGetGoogleServiceAccountRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.GetGoogleServiceAccountRequest} GetGoogleServiceAccountRequest instance + */ + GetGoogleServiceAccountRequest.create = function create(properties) { + return new GetGoogleServiceAccountRequest(properties); + }; + + /** + * Encodes the specified GetGoogleServiceAccountRequest message. Does not implicitly {@link google.storagetransfer.v1.GetGoogleServiceAccountRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.GetGoogleServiceAccountRequest + * @static + * @param {google.storagetransfer.v1.IGetGoogleServiceAccountRequest} message GetGoogleServiceAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGoogleServiceAccountRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified GetGoogleServiceAccountRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GetGoogleServiceAccountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.GetGoogleServiceAccountRequest + * @static + * @param {google.storagetransfer.v1.IGetGoogleServiceAccountRequest} message GetGoogleServiceAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGoogleServiceAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGoogleServiceAccountRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.GetGoogleServiceAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.GetGoogleServiceAccountRequest} GetGoogleServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGoogleServiceAccountRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.GetGoogleServiceAccountRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGoogleServiceAccountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.GetGoogleServiceAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.GetGoogleServiceAccountRequest} GetGoogleServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGoogleServiceAccountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGoogleServiceAccountRequest message. + * @function verify + * @memberof google.storagetransfer.v1.GetGoogleServiceAccountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGoogleServiceAccountRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a GetGoogleServiceAccountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.GetGoogleServiceAccountRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.GetGoogleServiceAccountRequest} GetGoogleServiceAccountRequest + */ + GetGoogleServiceAccountRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.GetGoogleServiceAccountRequest) + return object; + var message = new $root.google.storagetransfer.v1.GetGoogleServiceAccountRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a GetGoogleServiceAccountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.GetGoogleServiceAccountRequest + * @static + * @param {google.storagetransfer.v1.GetGoogleServiceAccountRequest} message GetGoogleServiceAccountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGoogleServiceAccountRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.projectId = ""; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this GetGoogleServiceAccountRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.GetGoogleServiceAccountRequest + * @instance + * @returns {Object.} JSON object + */ + GetGoogleServiceAccountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGoogleServiceAccountRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.GetGoogleServiceAccountRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGoogleServiceAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.GetGoogleServiceAccountRequest"; + }; + + return GetGoogleServiceAccountRequest; + })(); + + v1.CreateTransferJobRequest = (function() { + + /** + * Properties of a CreateTransferJobRequest. + * @memberof google.storagetransfer.v1 + * @interface ICreateTransferJobRequest + * @property {google.storagetransfer.v1.ITransferJob|null} [transferJob] CreateTransferJobRequest transferJob + */ + + /** + * Constructs a new CreateTransferJobRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a CreateTransferJobRequest. + * @implements ICreateTransferJobRequest + * @constructor + * @param {google.storagetransfer.v1.ICreateTransferJobRequest=} [properties] Properties to set + */ + function CreateTransferJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTransferJobRequest transferJob. + * @member {google.storagetransfer.v1.ITransferJob|null|undefined} transferJob + * @memberof google.storagetransfer.v1.CreateTransferJobRequest + * @instance + */ + CreateTransferJobRequest.prototype.transferJob = null; + + /** + * Creates a new CreateTransferJobRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.CreateTransferJobRequest + * @static + * @param {google.storagetransfer.v1.ICreateTransferJobRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.CreateTransferJobRequest} CreateTransferJobRequest instance + */ + CreateTransferJobRequest.create = function create(properties) { + return new CreateTransferJobRequest(properties); + }; + + /** + * Encodes the specified CreateTransferJobRequest message. Does not implicitly {@link google.storagetransfer.v1.CreateTransferJobRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.CreateTransferJobRequest + * @static + * @param {google.storagetransfer.v1.ICreateTransferJobRequest} message CreateTransferJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransferJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferJob != null && Object.hasOwnProperty.call(message, "transferJob")) + $root.google.storagetransfer.v1.TransferJob.encode(message.transferJob, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTransferJobRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.CreateTransferJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.CreateTransferJobRequest + * @static + * @param {google.storagetransfer.v1.ICreateTransferJobRequest} message CreateTransferJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransferJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTransferJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.CreateTransferJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.CreateTransferJobRequest} CreateTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransferJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.CreateTransferJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.transferJob = $root.google.storagetransfer.v1.TransferJob.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTransferJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.CreateTransferJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.CreateTransferJobRequest} CreateTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransferJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTransferJobRequest message. + * @function verify + * @memberof google.storagetransfer.v1.CreateTransferJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTransferJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferJob != null && message.hasOwnProperty("transferJob")) { + var error = $root.google.storagetransfer.v1.TransferJob.verify(message.transferJob); + if (error) + return "transferJob." + error; + } + return null; + }; + + /** + * Creates a CreateTransferJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.CreateTransferJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.CreateTransferJobRequest} CreateTransferJobRequest + */ + CreateTransferJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.CreateTransferJobRequest) + return object; + var message = new $root.google.storagetransfer.v1.CreateTransferJobRequest(); + if (object.transferJob != null) { + if (typeof object.transferJob !== "object") + throw TypeError(".google.storagetransfer.v1.CreateTransferJobRequest.transferJob: object expected"); + message.transferJob = $root.google.storagetransfer.v1.TransferJob.fromObject(object.transferJob); + } + return message; + }; + + /** + * Creates a plain object from a CreateTransferJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.CreateTransferJobRequest + * @static + * @param {google.storagetransfer.v1.CreateTransferJobRequest} message CreateTransferJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTransferJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.transferJob = null; + if (message.transferJob != null && message.hasOwnProperty("transferJob")) + object.transferJob = $root.google.storagetransfer.v1.TransferJob.toObject(message.transferJob, options); + return object; + }; + + /** + * Converts this CreateTransferJobRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.CreateTransferJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTransferJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTransferJobRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.CreateTransferJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTransferJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.CreateTransferJobRequest"; + }; + + return CreateTransferJobRequest; + })(); + + v1.UpdateTransferJobRequest = (function() { + + /** + * Properties of an UpdateTransferJobRequest. + * @memberof google.storagetransfer.v1 + * @interface IUpdateTransferJobRequest + * @property {string|null} [jobName] UpdateTransferJobRequest jobName + * @property {string|null} [projectId] UpdateTransferJobRequest projectId + * @property {google.storagetransfer.v1.ITransferJob|null} [transferJob] UpdateTransferJobRequest transferJob + * @property {google.protobuf.IFieldMask|null} [updateTransferJobFieldMask] UpdateTransferJobRequest updateTransferJobFieldMask + */ + + /** + * Constructs a new UpdateTransferJobRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an UpdateTransferJobRequest. + * @implements IUpdateTransferJobRequest + * @constructor + * @param {google.storagetransfer.v1.IUpdateTransferJobRequest=} [properties] Properties to set + */ + function UpdateTransferJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTransferJobRequest jobName. + * @member {string} jobName + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @instance + */ + UpdateTransferJobRequest.prototype.jobName = ""; + + /** + * UpdateTransferJobRequest projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @instance + */ + UpdateTransferJobRequest.prototype.projectId = ""; + + /** + * UpdateTransferJobRequest transferJob. + * @member {google.storagetransfer.v1.ITransferJob|null|undefined} transferJob + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @instance + */ + UpdateTransferJobRequest.prototype.transferJob = null; + + /** + * UpdateTransferJobRequest updateTransferJobFieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateTransferJobFieldMask + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @instance + */ + UpdateTransferJobRequest.prototype.updateTransferJobFieldMask = null; + + /** + * Creates a new UpdateTransferJobRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IUpdateTransferJobRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.UpdateTransferJobRequest} UpdateTransferJobRequest instance + */ + UpdateTransferJobRequest.create = function create(properties) { + return new UpdateTransferJobRequest(properties); + }; + + /** + * Encodes the specified UpdateTransferJobRequest message. Does not implicitly {@link google.storagetransfer.v1.UpdateTransferJobRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IUpdateTransferJobRequest} message UpdateTransferJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTransferJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobName != null && Object.hasOwnProperty.call(message, "jobName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.jobName); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.transferJob != null && Object.hasOwnProperty.call(message, "transferJob")) + $root.google.storagetransfer.v1.TransferJob.encode(message.transferJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTransferJobFieldMask != null && Object.hasOwnProperty.call(message, "updateTransferJobFieldMask")) + $root.google.protobuf.FieldMask.encode(message.updateTransferJobFieldMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateTransferJobRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.UpdateTransferJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IUpdateTransferJobRequest} message UpdateTransferJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTransferJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTransferJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.UpdateTransferJobRequest} UpdateTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTransferJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.UpdateTransferJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.jobName = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.transferJob = $root.google.storagetransfer.v1.TransferJob.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTransferJobFieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTransferJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.UpdateTransferJobRequest} UpdateTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTransferJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTransferJobRequest message. + * @function verify + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTransferJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobName != null && message.hasOwnProperty("jobName")) + if (!$util.isString(message.jobName)) + return "jobName: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.transferJob != null && message.hasOwnProperty("transferJob")) { + var error = $root.google.storagetransfer.v1.TransferJob.verify(message.transferJob); + if (error) + return "transferJob." + error; + } + if (message.updateTransferJobFieldMask != null && message.hasOwnProperty("updateTransferJobFieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateTransferJobFieldMask); + if (error) + return "updateTransferJobFieldMask." + error; + } + return null; + }; + + /** + * Creates an UpdateTransferJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.UpdateTransferJobRequest} UpdateTransferJobRequest + */ + UpdateTransferJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.UpdateTransferJobRequest) + return object; + var message = new $root.google.storagetransfer.v1.UpdateTransferJobRequest(); + if (object.jobName != null) + message.jobName = String(object.jobName); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.transferJob != null) { + if (typeof object.transferJob !== "object") + throw TypeError(".google.storagetransfer.v1.UpdateTransferJobRequest.transferJob: object expected"); + message.transferJob = $root.google.storagetransfer.v1.TransferJob.fromObject(object.transferJob); + } + if (object.updateTransferJobFieldMask != null) { + if (typeof object.updateTransferJobFieldMask !== "object") + throw TypeError(".google.storagetransfer.v1.UpdateTransferJobRequest.updateTransferJobFieldMask: object expected"); + message.updateTransferJobFieldMask = $root.google.protobuf.FieldMask.fromObject(object.updateTransferJobFieldMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTransferJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @static + * @param {google.storagetransfer.v1.UpdateTransferJobRequest} message UpdateTransferJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTransferJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.jobName = ""; + object.projectId = ""; + object.transferJob = null; + object.updateTransferJobFieldMask = null; + } + if (message.jobName != null && message.hasOwnProperty("jobName")) + object.jobName = message.jobName; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.transferJob != null && message.hasOwnProperty("transferJob")) + object.transferJob = $root.google.storagetransfer.v1.TransferJob.toObject(message.transferJob, options); + if (message.updateTransferJobFieldMask != null && message.hasOwnProperty("updateTransferJobFieldMask")) + object.updateTransferJobFieldMask = $root.google.protobuf.FieldMask.toObject(message.updateTransferJobFieldMask, options); + return object; + }; + + /** + * Converts this UpdateTransferJobRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTransferJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTransferJobRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.UpdateTransferJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTransferJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.UpdateTransferJobRequest"; + }; + + return UpdateTransferJobRequest; + })(); + + v1.GetTransferJobRequest = (function() { + + /** + * Properties of a GetTransferJobRequest. + * @memberof google.storagetransfer.v1 + * @interface IGetTransferJobRequest + * @property {string|null} [jobName] GetTransferJobRequest jobName + * @property {string|null} [projectId] GetTransferJobRequest projectId + */ + + /** + * Constructs a new GetTransferJobRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a GetTransferJobRequest. + * @implements IGetTransferJobRequest + * @constructor + * @param {google.storagetransfer.v1.IGetTransferJobRequest=} [properties] Properties to set + */ + function GetTransferJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTransferJobRequest jobName. + * @member {string} jobName + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @instance + */ + GetTransferJobRequest.prototype.jobName = ""; + + /** + * GetTransferJobRequest projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @instance + */ + GetTransferJobRequest.prototype.projectId = ""; + + /** + * Creates a new GetTransferJobRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IGetTransferJobRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.GetTransferJobRequest} GetTransferJobRequest instance + */ + GetTransferJobRequest.create = function create(properties) { + return new GetTransferJobRequest(properties); + }; + + /** + * Encodes the specified GetTransferJobRequest message. Does not implicitly {@link google.storagetransfer.v1.GetTransferJobRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IGetTransferJobRequest} message GetTransferJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransferJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobName != null && Object.hasOwnProperty.call(message, "jobName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.jobName); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified GetTransferJobRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GetTransferJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IGetTransferJobRequest} message GetTransferJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransferJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTransferJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.GetTransferJobRequest} GetTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransferJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.GetTransferJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.jobName = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTransferJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.GetTransferJobRequest} GetTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransferJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTransferJobRequest message. + * @function verify + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTransferJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobName != null && message.hasOwnProperty("jobName")) + if (!$util.isString(message.jobName)) + return "jobName: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a GetTransferJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.GetTransferJobRequest} GetTransferJobRequest + */ + GetTransferJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.GetTransferJobRequest) + return object; + var message = new $root.google.storagetransfer.v1.GetTransferJobRequest(); + if (object.jobName != null) + message.jobName = String(object.jobName); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a GetTransferJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @static + * @param {google.storagetransfer.v1.GetTransferJobRequest} message GetTransferJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTransferJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.jobName = ""; + object.projectId = ""; + } + if (message.jobName != null && message.hasOwnProperty("jobName")) + object.jobName = message.jobName; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this GetTransferJobRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetTransferJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTransferJobRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.GetTransferJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTransferJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.GetTransferJobRequest"; + }; + + return GetTransferJobRequest; + })(); + + v1.DeleteTransferJobRequest = (function() { + + /** + * Properties of a DeleteTransferJobRequest. + * @memberof google.storagetransfer.v1 + * @interface IDeleteTransferJobRequest + * @property {string|null} [jobName] DeleteTransferJobRequest jobName + * @property {string|null} [projectId] DeleteTransferJobRequest projectId + */ + + /** + * Constructs a new DeleteTransferJobRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a DeleteTransferJobRequest. + * @implements IDeleteTransferJobRequest + * @constructor + * @param {google.storagetransfer.v1.IDeleteTransferJobRequest=} [properties] Properties to set + */ + function DeleteTransferJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTransferJobRequest jobName. + * @member {string} jobName + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @instance + */ + DeleteTransferJobRequest.prototype.jobName = ""; + + /** + * DeleteTransferJobRequest projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @instance + */ + DeleteTransferJobRequest.prototype.projectId = ""; + + /** + * Creates a new DeleteTransferJobRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IDeleteTransferJobRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.DeleteTransferJobRequest} DeleteTransferJobRequest instance + */ + DeleteTransferJobRequest.create = function create(properties) { + return new DeleteTransferJobRequest(properties); + }; + + /** + * Encodes the specified DeleteTransferJobRequest message. Does not implicitly {@link google.storagetransfer.v1.DeleteTransferJobRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IDeleteTransferJobRequest} message DeleteTransferJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransferJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobName != null && Object.hasOwnProperty.call(message, "jobName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.jobName); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified DeleteTransferJobRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.DeleteTransferJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IDeleteTransferJobRequest} message DeleteTransferJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransferJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTransferJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.DeleteTransferJobRequest} DeleteTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransferJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.DeleteTransferJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.jobName = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTransferJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.DeleteTransferJobRequest} DeleteTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransferJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTransferJobRequest message. + * @function verify + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTransferJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobName != null && message.hasOwnProperty("jobName")) + if (!$util.isString(message.jobName)) + return "jobName: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a DeleteTransferJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.DeleteTransferJobRequest} DeleteTransferJobRequest + */ + DeleteTransferJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.DeleteTransferJobRequest) + return object; + var message = new $root.google.storagetransfer.v1.DeleteTransferJobRequest(); + if (object.jobName != null) + message.jobName = String(object.jobName); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a DeleteTransferJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @static + * @param {google.storagetransfer.v1.DeleteTransferJobRequest} message DeleteTransferJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTransferJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.jobName = ""; + object.projectId = ""; + } + if (message.jobName != null && message.hasOwnProperty("jobName")) + object.jobName = message.jobName; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this DeleteTransferJobRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTransferJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTransferJobRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.DeleteTransferJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTransferJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.DeleteTransferJobRequest"; + }; + + return DeleteTransferJobRequest; + })(); + + v1.ListTransferJobsRequest = (function() { + + /** + * Properties of a ListTransferJobsRequest. + * @memberof google.storagetransfer.v1 + * @interface IListTransferJobsRequest + * @property {string|null} [filter] ListTransferJobsRequest filter + * @property {number|null} [pageSize] ListTransferJobsRequest pageSize + * @property {string|null} [pageToken] ListTransferJobsRequest pageToken + */ + + /** + * Constructs a new ListTransferJobsRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a ListTransferJobsRequest. + * @implements IListTransferJobsRequest + * @constructor + * @param {google.storagetransfer.v1.IListTransferJobsRequest=} [properties] Properties to set + */ + function ListTransferJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferJobsRequest filter. + * @member {string} filter + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @instance + */ + ListTransferJobsRequest.prototype.filter = ""; + + /** + * ListTransferJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @instance + */ + ListTransferJobsRequest.prototype.pageSize = 0; + + /** + * ListTransferJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @instance + */ + ListTransferJobsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTransferJobsRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @static + * @param {google.storagetransfer.v1.IListTransferJobsRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ListTransferJobsRequest} ListTransferJobsRequest instance + */ + ListTransferJobsRequest.create = function create(properties) { + return new ListTransferJobsRequest(properties); + }; + + /** + * Encodes the specified ListTransferJobsRequest message. Does not implicitly {@link google.storagetransfer.v1.ListTransferJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @static + * @param {google.storagetransfer.v1.IListTransferJobsRequest} message ListTransferJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTransferJobsRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListTransferJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @static + * @param {google.storagetransfer.v1.IListTransferJobsRequest} message ListTransferJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.ListTransferJobsRequest} ListTransferJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.ListTransferJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.ListTransferJobsRequest} ListTransferJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferJobsRequest message. + * @function verify + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransferJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.ListTransferJobsRequest} ListTransferJobsRequest + */ + ListTransferJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ListTransferJobsRequest) + return object; + var message = new $root.google.storagetransfer.v1.ListTransferJobsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransferJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @static + * @param {google.storagetransfer.v1.ListTransferJobsRequest} message ListTransferJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTransferJobsRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTransferJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferJobsRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.ListTransferJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.ListTransferJobsRequest"; + }; + + return ListTransferJobsRequest; + })(); + + v1.ListTransferJobsResponse = (function() { + + /** + * Properties of a ListTransferJobsResponse. + * @memberof google.storagetransfer.v1 + * @interface IListTransferJobsResponse + * @property {Array.|null} [transferJobs] ListTransferJobsResponse transferJobs + * @property {string|null} [nextPageToken] ListTransferJobsResponse nextPageToken + */ + + /** + * Constructs a new ListTransferJobsResponse. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a ListTransferJobsResponse. + * @implements IListTransferJobsResponse + * @constructor + * @param {google.storagetransfer.v1.IListTransferJobsResponse=} [properties] Properties to set + */ + function ListTransferJobsResponse(properties) { + this.transferJobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferJobsResponse transferJobs. + * @member {Array.} transferJobs + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @instance + */ + ListTransferJobsResponse.prototype.transferJobs = $util.emptyArray; + + /** + * ListTransferJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @instance + */ + ListTransferJobsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTransferJobsResponse instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @static + * @param {google.storagetransfer.v1.IListTransferJobsResponse=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ListTransferJobsResponse} ListTransferJobsResponse instance + */ + ListTransferJobsResponse.create = function create(properties) { + return new ListTransferJobsResponse(properties); + }; + + /** + * Encodes the specified ListTransferJobsResponse message. Does not implicitly {@link google.storagetransfer.v1.ListTransferJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @static + * @param {google.storagetransfer.v1.IListTransferJobsResponse} message ListTransferJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferJobs != null && message.transferJobs.length) + for (var i = 0; i < message.transferJobs.length; ++i) + $root.google.storagetransfer.v1.TransferJob.encode(message.transferJobs[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 ListTransferJobsResponse message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListTransferJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @static + * @param {google.storagetransfer.v1.IListTransferJobsResponse} message ListTransferJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.ListTransferJobsResponse} ListTransferJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.ListTransferJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.transferJobs && message.transferJobs.length)) + message.transferJobs = []; + message.transferJobs.push($root.google.storagetransfer.v1.TransferJob.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.ListTransferJobsResponse} ListTransferJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferJobsResponse message. + * @function verify + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferJobs != null && message.hasOwnProperty("transferJobs")) { + if (!Array.isArray(message.transferJobs)) + return "transferJobs: array expected"; + for (var i = 0; i < message.transferJobs.length; ++i) { + var error = $root.google.storagetransfer.v1.TransferJob.verify(message.transferJobs[i]); + if (error) + return "transferJobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransferJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.ListTransferJobsResponse} ListTransferJobsResponse + */ + ListTransferJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ListTransferJobsResponse) + return object; + var message = new $root.google.storagetransfer.v1.ListTransferJobsResponse(); + if (object.transferJobs) { + if (!Array.isArray(object.transferJobs)) + throw TypeError(".google.storagetransfer.v1.ListTransferJobsResponse.transferJobs: array expected"); + message.transferJobs = []; + for (var i = 0; i < object.transferJobs.length; ++i) { + if (typeof object.transferJobs[i] !== "object") + throw TypeError(".google.storagetransfer.v1.ListTransferJobsResponse.transferJobs: object expected"); + message.transferJobs[i] = $root.google.storagetransfer.v1.TransferJob.fromObject(object.transferJobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransferJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @static + * @param {google.storagetransfer.v1.ListTransferJobsResponse} message ListTransferJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transferJobs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.transferJobs && message.transferJobs.length) { + object.transferJobs = []; + for (var j = 0; j < message.transferJobs.length; ++j) + object.transferJobs[j] = $root.google.storagetransfer.v1.TransferJob.toObject(message.transferJobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTransferJobsResponse to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTransferJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferJobsResponse + * @function getTypeUrl + * @memberof google.storagetransfer.v1.ListTransferJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.ListTransferJobsResponse"; + }; + + return ListTransferJobsResponse; + })(); + + v1.PauseTransferOperationRequest = (function() { + + /** + * Properties of a PauseTransferOperationRequest. + * @memberof google.storagetransfer.v1 + * @interface IPauseTransferOperationRequest + * @property {string|null} [name] PauseTransferOperationRequest name + */ + + /** + * Constructs a new PauseTransferOperationRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a PauseTransferOperationRequest. + * @implements IPauseTransferOperationRequest + * @constructor + * @param {google.storagetransfer.v1.IPauseTransferOperationRequest=} [properties] Properties to set + */ + function PauseTransferOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PauseTransferOperationRequest name. + * @member {string} name + * @memberof google.storagetransfer.v1.PauseTransferOperationRequest + * @instance + */ + PauseTransferOperationRequest.prototype.name = ""; + + /** + * Creates a new PauseTransferOperationRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.PauseTransferOperationRequest + * @static + * @param {google.storagetransfer.v1.IPauseTransferOperationRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.PauseTransferOperationRequest} PauseTransferOperationRequest instance + */ + PauseTransferOperationRequest.create = function create(properties) { + return new PauseTransferOperationRequest(properties); + }; + + /** + * Encodes the specified PauseTransferOperationRequest message. Does not implicitly {@link google.storagetransfer.v1.PauseTransferOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.PauseTransferOperationRequest + * @static + * @param {google.storagetransfer.v1.IPauseTransferOperationRequest} message PauseTransferOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseTransferOperationRequest.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 PauseTransferOperationRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.PauseTransferOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.PauseTransferOperationRequest + * @static + * @param {google.storagetransfer.v1.IPauseTransferOperationRequest} message PauseTransferOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseTransferOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PauseTransferOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.PauseTransferOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.PauseTransferOperationRequest} PauseTransferOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseTransferOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.PauseTransferOperationRequest(); + 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 PauseTransferOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.PauseTransferOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.PauseTransferOperationRequest} PauseTransferOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseTransferOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PauseTransferOperationRequest message. + * @function verify + * @memberof google.storagetransfer.v1.PauseTransferOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PauseTransferOperationRequest.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 PauseTransferOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.PauseTransferOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.PauseTransferOperationRequest} PauseTransferOperationRequest + */ + PauseTransferOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.PauseTransferOperationRequest) + return object; + var message = new $root.google.storagetransfer.v1.PauseTransferOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PauseTransferOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.PauseTransferOperationRequest + * @static + * @param {google.storagetransfer.v1.PauseTransferOperationRequest} message PauseTransferOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PauseTransferOperationRequest.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 PauseTransferOperationRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.PauseTransferOperationRequest + * @instance + * @returns {Object.} JSON object + */ + PauseTransferOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PauseTransferOperationRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.PauseTransferOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PauseTransferOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.PauseTransferOperationRequest"; + }; + + return PauseTransferOperationRequest; + })(); + + v1.ResumeTransferOperationRequest = (function() { + + /** + * Properties of a ResumeTransferOperationRequest. + * @memberof google.storagetransfer.v1 + * @interface IResumeTransferOperationRequest + * @property {string|null} [name] ResumeTransferOperationRequest name + */ + + /** + * Constructs a new ResumeTransferOperationRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a ResumeTransferOperationRequest. + * @implements IResumeTransferOperationRequest + * @constructor + * @param {google.storagetransfer.v1.IResumeTransferOperationRequest=} [properties] Properties to set + */ + function ResumeTransferOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResumeTransferOperationRequest name. + * @member {string} name + * @memberof google.storagetransfer.v1.ResumeTransferOperationRequest + * @instance + */ + ResumeTransferOperationRequest.prototype.name = ""; + + /** + * Creates a new ResumeTransferOperationRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.ResumeTransferOperationRequest + * @static + * @param {google.storagetransfer.v1.IResumeTransferOperationRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ResumeTransferOperationRequest} ResumeTransferOperationRequest instance + */ + ResumeTransferOperationRequest.create = function create(properties) { + return new ResumeTransferOperationRequest(properties); + }; + + /** + * Encodes the specified ResumeTransferOperationRequest message. Does not implicitly {@link google.storagetransfer.v1.ResumeTransferOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.ResumeTransferOperationRequest + * @static + * @param {google.storagetransfer.v1.IResumeTransferOperationRequest} message ResumeTransferOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeTransferOperationRequest.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 ResumeTransferOperationRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ResumeTransferOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.ResumeTransferOperationRequest + * @static + * @param {google.storagetransfer.v1.IResumeTransferOperationRequest} message ResumeTransferOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeTransferOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResumeTransferOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.ResumeTransferOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.ResumeTransferOperationRequest} ResumeTransferOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeTransferOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.ResumeTransferOperationRequest(); + 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 ResumeTransferOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.ResumeTransferOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.ResumeTransferOperationRequest} ResumeTransferOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeTransferOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResumeTransferOperationRequest message. + * @function verify + * @memberof google.storagetransfer.v1.ResumeTransferOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResumeTransferOperationRequest.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 ResumeTransferOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.ResumeTransferOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.ResumeTransferOperationRequest} ResumeTransferOperationRequest + */ + ResumeTransferOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ResumeTransferOperationRequest) + return object; + var message = new $root.google.storagetransfer.v1.ResumeTransferOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ResumeTransferOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.ResumeTransferOperationRequest + * @static + * @param {google.storagetransfer.v1.ResumeTransferOperationRequest} message ResumeTransferOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResumeTransferOperationRequest.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 ResumeTransferOperationRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.ResumeTransferOperationRequest + * @instance + * @returns {Object.} JSON object + */ + ResumeTransferOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResumeTransferOperationRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.ResumeTransferOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResumeTransferOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.ResumeTransferOperationRequest"; + }; + + return ResumeTransferOperationRequest; + })(); + + v1.RunTransferJobRequest = (function() { + + /** + * Properties of a RunTransferJobRequest. + * @memberof google.storagetransfer.v1 + * @interface IRunTransferJobRequest + * @property {string|null} [jobName] RunTransferJobRequest jobName + * @property {string|null} [projectId] RunTransferJobRequest projectId + */ + + /** + * Constructs a new RunTransferJobRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a RunTransferJobRequest. + * @implements IRunTransferJobRequest + * @constructor + * @param {google.storagetransfer.v1.IRunTransferJobRequest=} [properties] Properties to set + */ + function RunTransferJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunTransferJobRequest jobName. + * @member {string} jobName + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @instance + */ + RunTransferJobRequest.prototype.jobName = ""; + + /** + * RunTransferJobRequest projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @instance + */ + RunTransferJobRequest.prototype.projectId = ""; + + /** + * Creates a new RunTransferJobRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IRunTransferJobRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.RunTransferJobRequest} RunTransferJobRequest instance + */ + RunTransferJobRequest.create = function create(properties) { + return new RunTransferJobRequest(properties); + }; + + /** + * Encodes the specified RunTransferJobRequest message. Does not implicitly {@link google.storagetransfer.v1.RunTransferJobRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IRunTransferJobRequest} message RunTransferJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTransferJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobName != null && Object.hasOwnProperty.call(message, "jobName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.jobName); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified RunTransferJobRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.RunTransferJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @static + * @param {google.storagetransfer.v1.IRunTransferJobRequest} message RunTransferJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunTransferJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunTransferJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.RunTransferJobRequest} RunTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTransferJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.RunTransferJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.jobName = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunTransferJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.RunTransferJobRequest} RunTransferJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunTransferJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunTransferJobRequest message. + * @function verify + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunTransferJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobName != null && message.hasOwnProperty("jobName")) + if (!$util.isString(message.jobName)) + return "jobName: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a RunTransferJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.RunTransferJobRequest} RunTransferJobRequest + */ + RunTransferJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.RunTransferJobRequest) + return object; + var message = new $root.google.storagetransfer.v1.RunTransferJobRequest(); + if (object.jobName != null) + message.jobName = String(object.jobName); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a RunTransferJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @static + * @param {google.storagetransfer.v1.RunTransferJobRequest} message RunTransferJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunTransferJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.jobName = ""; + object.projectId = ""; + } + if (message.jobName != null && message.hasOwnProperty("jobName")) + object.jobName = message.jobName; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this RunTransferJobRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @instance + * @returns {Object.} JSON object + */ + RunTransferJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunTransferJobRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.RunTransferJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunTransferJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.RunTransferJobRequest"; + }; + + return RunTransferJobRequest; + })(); + + v1.CreateAgentPoolRequest = (function() { + + /** + * Properties of a CreateAgentPoolRequest. + * @memberof google.storagetransfer.v1 + * @interface ICreateAgentPoolRequest + * @property {string|null} [projectId] CreateAgentPoolRequest projectId + * @property {google.storagetransfer.v1.IAgentPool|null} [agentPool] CreateAgentPoolRequest agentPool + * @property {string|null} [agentPoolId] CreateAgentPoolRequest agentPoolId + */ + + /** + * Constructs a new CreateAgentPoolRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a CreateAgentPoolRequest. + * @implements ICreateAgentPoolRequest + * @constructor + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest=} [properties] Properties to set + */ + function CreateAgentPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAgentPoolRequest projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @instance + */ + CreateAgentPoolRequest.prototype.projectId = ""; + + /** + * CreateAgentPoolRequest agentPool. + * @member {google.storagetransfer.v1.IAgentPool|null|undefined} agentPool + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @instance + */ + CreateAgentPoolRequest.prototype.agentPool = null; + + /** + * CreateAgentPoolRequest agentPoolId. + * @member {string} agentPoolId + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @instance + */ + CreateAgentPoolRequest.prototype.agentPoolId = ""; + + /** + * Creates a new CreateAgentPoolRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.CreateAgentPoolRequest} CreateAgentPoolRequest instance + */ + CreateAgentPoolRequest.create = function create(properties) { + return new CreateAgentPoolRequest(properties); + }; + + /** + * Encodes the specified CreateAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.CreateAgentPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest} message CreateAgentPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.agentPool != null && Object.hasOwnProperty.call(message, "agentPool")) + $root.google.storagetransfer.v1.AgentPool.encode(message.agentPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.agentPoolId != null && Object.hasOwnProperty.call(message, "agentPoolId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.agentPoolId); + return writer; + }; + + /** + * Encodes the specified CreateAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.CreateAgentPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.ICreateAgentPoolRequest} message CreateAgentPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAgentPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAgentPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.CreateAgentPoolRequest} CreateAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.CreateAgentPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.agentPool = $root.google.storagetransfer.v1.AgentPool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.agentPoolId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAgentPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.CreateAgentPoolRequest} CreateAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAgentPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAgentPoolRequest message. + * @function verify + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAgentPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.agentPool != null && message.hasOwnProperty("agentPool")) { + var error = $root.google.storagetransfer.v1.AgentPool.verify(message.agentPool); + if (error) + return "agentPool." + error; + } + if (message.agentPoolId != null && message.hasOwnProperty("agentPoolId")) + if (!$util.isString(message.agentPoolId)) + return "agentPoolId: string expected"; + return null; + }; + + /** + * Creates a CreateAgentPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.CreateAgentPoolRequest} CreateAgentPoolRequest + */ + CreateAgentPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.CreateAgentPoolRequest) + return object; + var message = new $root.google.storagetransfer.v1.CreateAgentPoolRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.agentPool != null) { + if (typeof object.agentPool !== "object") + throw TypeError(".google.storagetransfer.v1.CreateAgentPoolRequest.agentPool: object expected"); + message.agentPool = $root.google.storagetransfer.v1.AgentPool.fromObject(object.agentPool); + } + if (object.agentPoolId != null) + message.agentPoolId = String(object.agentPoolId); + return message; + }; + + /** + * Creates a plain object from a CreateAgentPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.CreateAgentPoolRequest} message CreateAgentPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAgentPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.agentPool = null; + object.agentPoolId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.agentPool != null && message.hasOwnProperty("agentPool")) + object.agentPool = $root.google.storagetransfer.v1.AgentPool.toObject(message.agentPool, options); + if (message.agentPoolId != null && message.hasOwnProperty("agentPoolId")) + object.agentPoolId = message.agentPoolId; + return object; + }; + + /** + * Converts this CreateAgentPoolRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAgentPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAgentPoolRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.CreateAgentPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAgentPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.CreateAgentPoolRequest"; + }; + + return CreateAgentPoolRequest; + })(); + + v1.UpdateAgentPoolRequest = (function() { + + /** + * Properties of an UpdateAgentPoolRequest. + * @memberof google.storagetransfer.v1 + * @interface IUpdateAgentPoolRequest + * @property {google.storagetransfer.v1.IAgentPool|null} [agentPool] UpdateAgentPoolRequest agentPool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAgentPoolRequest updateMask + */ + + /** + * Constructs a new UpdateAgentPoolRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an UpdateAgentPoolRequest. + * @implements IUpdateAgentPoolRequest + * @constructor + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest=} [properties] Properties to set + */ + function UpdateAgentPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAgentPoolRequest agentPool. + * @member {google.storagetransfer.v1.IAgentPool|null|undefined} agentPool + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @instance + */ + UpdateAgentPoolRequest.prototype.agentPool = null; + + /** + * UpdateAgentPoolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @instance + */ + UpdateAgentPoolRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAgentPoolRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.UpdateAgentPoolRequest} UpdateAgentPoolRequest instance + */ + UpdateAgentPoolRequest.create = function create(properties) { + return new UpdateAgentPoolRequest(properties); + }; + + /** + * Encodes the specified UpdateAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.UpdateAgentPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest} message UpdateAgentPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agentPool != null && Object.hasOwnProperty.call(message, "agentPool")) + $root.google.storagetransfer.v1.AgentPool.encode(message.agentPool, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.UpdateAgentPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.IUpdateAgentPoolRequest} message UpdateAgentPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAgentPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAgentPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.UpdateAgentPoolRequest} UpdateAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.UpdateAgentPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.agentPool = $root.google.storagetransfer.v1.AgentPool.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAgentPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.UpdateAgentPoolRequest} UpdateAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAgentPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAgentPoolRequest message. + * @function verify + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAgentPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agentPool != null && message.hasOwnProperty("agentPool")) { + var error = $root.google.storagetransfer.v1.AgentPool.verify(message.agentPool); + if (error) + return "agentPool." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAgentPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.UpdateAgentPoolRequest} UpdateAgentPoolRequest + */ + UpdateAgentPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.UpdateAgentPoolRequest) + return object; + var message = new $root.google.storagetransfer.v1.UpdateAgentPoolRequest(); + if (object.agentPool != null) { + if (typeof object.agentPool !== "object") + throw TypeError(".google.storagetransfer.v1.UpdateAgentPoolRequest.agentPool: object expected"); + message.agentPool = $root.google.storagetransfer.v1.AgentPool.fromObject(object.agentPool); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.storagetransfer.v1.UpdateAgentPoolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAgentPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.UpdateAgentPoolRequest} message UpdateAgentPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAgentPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.agentPool = null; + object.updateMask = null; + } + if (message.agentPool != null && message.hasOwnProperty("agentPool")) + object.agentPool = $root.google.storagetransfer.v1.AgentPool.toObject(message.agentPool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAgentPoolRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAgentPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAgentPoolRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.UpdateAgentPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAgentPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.UpdateAgentPoolRequest"; + }; + + return UpdateAgentPoolRequest; + })(); + + v1.GetAgentPoolRequest = (function() { + + /** + * Properties of a GetAgentPoolRequest. + * @memberof google.storagetransfer.v1 + * @interface IGetAgentPoolRequest + * @property {string|null} [name] GetAgentPoolRequest name + */ + + /** + * Constructs a new GetAgentPoolRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a GetAgentPoolRequest. + * @implements IGetAgentPoolRequest + * @constructor + * @param {google.storagetransfer.v1.IGetAgentPoolRequest=} [properties] Properties to set + */ + function GetAgentPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAgentPoolRequest name. + * @member {string} name + * @memberof google.storagetransfer.v1.GetAgentPoolRequest + * @instance + */ + GetAgentPoolRequest.prototype.name = ""; + + /** + * Creates a new GetAgentPoolRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.GetAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.IGetAgentPoolRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.GetAgentPoolRequest} GetAgentPoolRequest instance + */ + GetAgentPoolRequest.create = function create(properties) { + return new GetAgentPoolRequest(properties); + }; + + /** + * Encodes the specified GetAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.GetAgentPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.GetAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.IGetAgentPoolRequest} message GetAgentPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentPoolRequest.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 GetAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GetAgentPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.GetAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.IGetAgentPoolRequest} message GetAgentPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAgentPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.GetAgentPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.GetAgentPoolRequest} GetAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.GetAgentPoolRequest(); + 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 GetAgentPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.GetAgentPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.GetAgentPoolRequest} GetAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAgentPoolRequest message. + * @function verify + * @memberof google.storagetransfer.v1.GetAgentPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAgentPoolRequest.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 GetAgentPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.GetAgentPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.GetAgentPoolRequest} GetAgentPoolRequest + */ + GetAgentPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.GetAgentPoolRequest) + return object; + var message = new $root.google.storagetransfer.v1.GetAgentPoolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAgentPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.GetAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.GetAgentPoolRequest} message GetAgentPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAgentPoolRequest.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 GetAgentPoolRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.GetAgentPoolRequest + * @instance + * @returns {Object.} JSON object + */ + GetAgentPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAgentPoolRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.GetAgentPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAgentPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.GetAgentPoolRequest"; + }; + + return GetAgentPoolRequest; + })(); + + v1.DeleteAgentPoolRequest = (function() { + + /** + * Properties of a DeleteAgentPoolRequest. + * @memberof google.storagetransfer.v1 + * @interface IDeleteAgentPoolRequest + * @property {string|null} [name] DeleteAgentPoolRequest name + */ + + /** + * Constructs a new DeleteAgentPoolRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a DeleteAgentPoolRequest. + * @implements IDeleteAgentPoolRequest + * @constructor + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest=} [properties] Properties to set + */ + function DeleteAgentPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAgentPoolRequest name. + * @member {string} name + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest + * @instance + */ + DeleteAgentPoolRequest.prototype.name = ""; + + /** + * Creates a new DeleteAgentPoolRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.DeleteAgentPoolRequest} DeleteAgentPoolRequest instance + */ + DeleteAgentPoolRequest.create = function create(properties) { + return new DeleteAgentPoolRequest(properties); + }; + + /** + * Encodes the specified DeleteAgentPoolRequest message. Does not implicitly {@link google.storagetransfer.v1.DeleteAgentPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest} message DeleteAgentPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentPoolRequest.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 DeleteAgentPoolRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.DeleteAgentPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.IDeleteAgentPoolRequest} message DeleteAgentPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAgentPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.DeleteAgentPoolRequest} DeleteAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.DeleteAgentPoolRequest(); + 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 DeleteAgentPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.DeleteAgentPoolRequest} DeleteAgentPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAgentPoolRequest message. + * @function verify + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAgentPoolRequest.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 DeleteAgentPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.DeleteAgentPoolRequest} DeleteAgentPoolRequest + */ + DeleteAgentPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.DeleteAgentPoolRequest) + return object; + var message = new $root.google.storagetransfer.v1.DeleteAgentPoolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAgentPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest + * @static + * @param {google.storagetransfer.v1.DeleteAgentPoolRequest} message DeleteAgentPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAgentPoolRequest.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 DeleteAgentPoolRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAgentPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAgentPoolRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.DeleteAgentPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAgentPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.DeleteAgentPoolRequest"; + }; + + return DeleteAgentPoolRequest; + })(); + + v1.ListAgentPoolsRequest = (function() { + + /** + * Properties of a ListAgentPoolsRequest. + * @memberof google.storagetransfer.v1 + * @interface IListAgentPoolsRequest + * @property {string|null} [projectId] ListAgentPoolsRequest projectId + * @property {string|null} [filter] ListAgentPoolsRequest filter + * @property {number|null} [pageSize] ListAgentPoolsRequest pageSize + * @property {string|null} [pageToken] ListAgentPoolsRequest pageToken + */ + + /** + * Constructs a new ListAgentPoolsRequest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a ListAgentPoolsRequest. + * @implements IListAgentPoolsRequest + * @constructor + * @param {google.storagetransfer.v1.IListAgentPoolsRequest=} [properties] Properties to set + */ + function ListAgentPoolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentPoolsRequest projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @instance + */ + ListAgentPoolsRequest.prototype.projectId = ""; + + /** + * ListAgentPoolsRequest filter. + * @member {string} filter + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @instance + */ + ListAgentPoolsRequest.prototype.filter = ""; + + /** + * ListAgentPoolsRequest pageSize. + * @member {number} pageSize + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @instance + */ + ListAgentPoolsRequest.prototype.pageSize = 0; + + /** + * ListAgentPoolsRequest pageToken. + * @member {string} pageToken + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @instance + */ + ListAgentPoolsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAgentPoolsRequest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @static + * @param {google.storagetransfer.v1.IListAgentPoolsRequest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ListAgentPoolsRequest} ListAgentPoolsRequest instance + */ + ListAgentPoolsRequest.create = function create(properties) { + return new ListAgentPoolsRequest(properties); + }; + + /** + * Encodes the specified ListAgentPoolsRequest message. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsRequest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @static + * @param {google.storagetransfer.v1.IListAgentPoolsRequest} message ListAgentPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentPoolsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAgentPoolsRequest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @static + * @param {google.storagetransfer.v1.IListAgentPoolsRequest} message ListAgentPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentPoolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.ListAgentPoolsRequest} ListAgentPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentPoolsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.ListAgentPoolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentPoolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.ListAgentPoolsRequest} ListAgentPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentPoolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentPoolsRequest message. + * @function verify + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentPoolsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAgentPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.ListAgentPoolsRequest} ListAgentPoolsRequest + */ + ListAgentPoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ListAgentPoolsRequest) + return object; + var message = new $root.google.storagetransfer.v1.ListAgentPoolsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAgentPoolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @static + * @param {google.storagetransfer.v1.ListAgentPoolsRequest} message ListAgentPoolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentPoolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAgentPoolsRequest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAgentPoolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentPoolsRequest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.ListAgentPoolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentPoolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.ListAgentPoolsRequest"; + }; + + return ListAgentPoolsRequest; + })(); + + v1.ListAgentPoolsResponse = (function() { + + /** + * Properties of a ListAgentPoolsResponse. + * @memberof google.storagetransfer.v1 + * @interface IListAgentPoolsResponse + * @property {Array.|null} [agentPools] ListAgentPoolsResponse agentPools + * @property {string|null} [nextPageToken] ListAgentPoolsResponse nextPageToken + */ + + /** + * Constructs a new ListAgentPoolsResponse. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a ListAgentPoolsResponse. + * @implements IListAgentPoolsResponse + * @constructor + * @param {google.storagetransfer.v1.IListAgentPoolsResponse=} [properties] Properties to set + */ + function ListAgentPoolsResponse(properties) { + this.agentPools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAgentPoolsResponse agentPools. + * @member {Array.} agentPools + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @instance + */ + ListAgentPoolsResponse.prototype.agentPools = $util.emptyArray; + + /** + * ListAgentPoolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @instance + */ + ListAgentPoolsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAgentPoolsResponse instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @static + * @param {google.storagetransfer.v1.IListAgentPoolsResponse=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ListAgentPoolsResponse} ListAgentPoolsResponse instance + */ + ListAgentPoolsResponse.create = function create(properties) { + return new ListAgentPoolsResponse(properties); + }; + + /** + * Encodes the specified ListAgentPoolsResponse message. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsResponse.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @static + * @param {google.storagetransfer.v1.IListAgentPoolsResponse} message ListAgentPoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentPoolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agentPools != null && message.agentPools.length) + for (var i = 0; i < message.agentPools.length; ++i) + $root.google.storagetransfer.v1.AgentPool.encode(message.agentPools[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 ListAgentPoolsResponse message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ListAgentPoolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @static + * @param {google.storagetransfer.v1.IListAgentPoolsResponse} message ListAgentPoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAgentPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAgentPoolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.ListAgentPoolsResponse} ListAgentPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentPoolsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.ListAgentPoolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.agentPools && message.agentPools.length)) + message.agentPools = []; + message.agentPools.push($root.google.storagetransfer.v1.AgentPool.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAgentPoolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.ListAgentPoolsResponse} ListAgentPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAgentPoolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAgentPoolsResponse message. + * @function verify + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAgentPoolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agentPools != null && message.hasOwnProperty("agentPools")) { + if (!Array.isArray(message.agentPools)) + return "agentPools: array expected"; + for (var i = 0; i < message.agentPools.length; ++i) { + var error = $root.google.storagetransfer.v1.AgentPool.verify(message.agentPools[i]); + if (error) + return "agentPools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAgentPoolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.ListAgentPoolsResponse} ListAgentPoolsResponse + */ + ListAgentPoolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ListAgentPoolsResponse) + return object; + var message = new $root.google.storagetransfer.v1.ListAgentPoolsResponse(); + if (object.agentPools) { + if (!Array.isArray(object.agentPools)) + throw TypeError(".google.storagetransfer.v1.ListAgentPoolsResponse.agentPools: array expected"); + message.agentPools = []; + for (var i = 0; i < object.agentPools.length; ++i) { + if (typeof object.agentPools[i] !== "object") + throw TypeError(".google.storagetransfer.v1.ListAgentPoolsResponse.agentPools: object expected"); + message.agentPools[i] = $root.google.storagetransfer.v1.AgentPool.fromObject(object.agentPools[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAgentPoolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @static + * @param {google.storagetransfer.v1.ListAgentPoolsResponse} message ListAgentPoolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAgentPoolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.agentPools = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.agentPools && message.agentPools.length) { + object.agentPools = []; + for (var j = 0; j < message.agentPools.length; ++j) + object.agentPools[j] = $root.google.storagetransfer.v1.AgentPool.toObject(message.agentPools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAgentPoolsResponse to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAgentPoolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAgentPoolsResponse + * @function getTypeUrl + * @memberof google.storagetransfer.v1.ListAgentPoolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAgentPoolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.ListAgentPoolsResponse"; + }; + + return ListAgentPoolsResponse; + })(); + + v1.GoogleServiceAccount = (function() { + + /** + * Properties of a GoogleServiceAccount. + * @memberof google.storagetransfer.v1 + * @interface IGoogleServiceAccount + * @property {string|null} [accountEmail] GoogleServiceAccount accountEmail + * @property {string|null} [subjectId] GoogleServiceAccount subjectId + */ + + /** + * Constructs a new GoogleServiceAccount. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a GoogleServiceAccount. + * @implements IGoogleServiceAccount + * @constructor + * @param {google.storagetransfer.v1.IGoogleServiceAccount=} [properties] Properties to set + */ + function GoogleServiceAccount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleServiceAccount accountEmail. + * @member {string} accountEmail + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @instance + */ + GoogleServiceAccount.prototype.accountEmail = ""; + + /** + * GoogleServiceAccount subjectId. + * @member {string} subjectId + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @instance + */ + GoogleServiceAccount.prototype.subjectId = ""; + + /** + * Creates a new GoogleServiceAccount instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @static + * @param {google.storagetransfer.v1.IGoogleServiceAccount=} [properties] Properties to set + * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount instance + */ + GoogleServiceAccount.create = function create(properties) { + return new GoogleServiceAccount(properties); + }; + + /** + * Encodes the specified GoogleServiceAccount message. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @static + * @param {google.storagetransfer.v1.IGoogleServiceAccount} message GoogleServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleServiceAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accountEmail != null && Object.hasOwnProperty.call(message, "accountEmail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accountEmail); + if (message.subjectId != null && Object.hasOwnProperty.call(message, "subjectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subjectId); + return writer; + }; + + /** + * Encodes the specified GoogleServiceAccount message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GoogleServiceAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @static + * @param {google.storagetransfer.v1.IGoogleServiceAccount} message GoogleServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleServiceAccount message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleServiceAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.GoogleServiceAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accountEmail = reader.string(); + break; + } + case 2: { + message.subjectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleServiceAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleServiceAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleServiceAccount message. + * @function verify + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleServiceAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accountEmail != null && message.hasOwnProperty("accountEmail")) + if (!$util.isString(message.accountEmail)) + return "accountEmail: string expected"; + if (message.subjectId != null && message.hasOwnProperty("subjectId")) + if (!$util.isString(message.subjectId)) + return "subjectId: string expected"; + return null; + }; + + /** + * Creates a GoogleServiceAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.GoogleServiceAccount} GoogleServiceAccount + */ + GoogleServiceAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.GoogleServiceAccount) + return object; + var message = new $root.google.storagetransfer.v1.GoogleServiceAccount(); + if (object.accountEmail != null) + message.accountEmail = String(object.accountEmail); + if (object.subjectId != null) + message.subjectId = String(object.subjectId); + return message; + }; + + /** + * Creates a plain object from a GoogleServiceAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @static + * @param {google.storagetransfer.v1.GoogleServiceAccount} message GoogleServiceAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleServiceAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.accountEmail = ""; + object.subjectId = ""; + } + if (message.accountEmail != null && message.hasOwnProperty("accountEmail")) + object.accountEmail = message.accountEmail; + if (message.subjectId != null && message.hasOwnProperty("subjectId")) + object.subjectId = message.subjectId; + return object; + }; + + /** + * Converts this GoogleServiceAccount to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @instance + * @returns {Object.} JSON object + */ + GoogleServiceAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleServiceAccount + * @function getTypeUrl + * @memberof google.storagetransfer.v1.GoogleServiceAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.GoogleServiceAccount"; + }; + + return GoogleServiceAccount; + })(); + + v1.AwsAccessKey = (function() { + + /** + * Properties of an AwsAccessKey. + * @memberof google.storagetransfer.v1 + * @interface IAwsAccessKey + * @property {string|null} [accessKeyId] AwsAccessKey accessKeyId + * @property {string|null} [secretAccessKey] AwsAccessKey secretAccessKey + */ + + /** + * Constructs a new AwsAccessKey. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an AwsAccessKey. + * @implements IAwsAccessKey + * @constructor + * @param {google.storagetransfer.v1.IAwsAccessKey=} [properties] Properties to set + */ + function AwsAccessKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsAccessKey accessKeyId. + * @member {string} accessKeyId + * @memberof google.storagetransfer.v1.AwsAccessKey + * @instance + */ + AwsAccessKey.prototype.accessKeyId = ""; + + /** + * AwsAccessKey secretAccessKey. + * @member {string} secretAccessKey + * @memberof google.storagetransfer.v1.AwsAccessKey + * @instance + */ + AwsAccessKey.prototype.secretAccessKey = ""; + + /** + * Creates a new AwsAccessKey instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.AwsAccessKey + * @static + * @param {google.storagetransfer.v1.IAwsAccessKey=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey instance + */ + AwsAccessKey.create = function create(properties) { + return new AwsAccessKey(properties); + }; + + /** + * Encodes the specified AwsAccessKey message. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.AwsAccessKey + * @static + * @param {google.storagetransfer.v1.IAwsAccessKey} message AwsAccessKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsAccessKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessKeyId != null && Object.hasOwnProperty.call(message, "accessKeyId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accessKeyId); + if (message.secretAccessKey != null && Object.hasOwnProperty.call(message, "secretAccessKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.secretAccessKey); + return writer; + }; + + /** + * Encodes the specified AwsAccessKey message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsAccessKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.AwsAccessKey + * @static + * @param {google.storagetransfer.v1.IAwsAccessKey} message AwsAccessKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsAccessKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsAccessKey message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.AwsAccessKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsAccessKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AwsAccessKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessKeyId = reader.string(); + break; + } + case 2: { + message.secretAccessKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsAccessKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.AwsAccessKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsAccessKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsAccessKey message. + * @function verify + * @memberof google.storagetransfer.v1.AwsAccessKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsAccessKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accessKeyId != null && message.hasOwnProperty("accessKeyId")) + if (!$util.isString(message.accessKeyId)) + return "accessKeyId: string expected"; + if (message.secretAccessKey != null && message.hasOwnProperty("secretAccessKey")) + if (!$util.isString(message.secretAccessKey)) + return "secretAccessKey: string expected"; + return null; + }; + + /** + * Creates an AwsAccessKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.AwsAccessKey + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.AwsAccessKey} AwsAccessKey + */ + AwsAccessKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AwsAccessKey) + return object; + var message = new $root.google.storagetransfer.v1.AwsAccessKey(); + if (object.accessKeyId != null) + message.accessKeyId = String(object.accessKeyId); + if (object.secretAccessKey != null) + message.secretAccessKey = String(object.secretAccessKey); + return message; + }; + + /** + * Creates a plain object from an AwsAccessKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.AwsAccessKey + * @static + * @param {google.storagetransfer.v1.AwsAccessKey} message AwsAccessKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsAccessKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.accessKeyId = ""; + object.secretAccessKey = ""; + } + if (message.accessKeyId != null && message.hasOwnProperty("accessKeyId")) + object.accessKeyId = message.accessKeyId; + if (message.secretAccessKey != null && message.hasOwnProperty("secretAccessKey")) + object.secretAccessKey = message.secretAccessKey; + return object; + }; + + /** + * Converts this AwsAccessKey to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.AwsAccessKey + * @instance + * @returns {Object.} JSON object + */ + AwsAccessKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsAccessKey + * @function getTypeUrl + * @memberof google.storagetransfer.v1.AwsAccessKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsAccessKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.AwsAccessKey"; + }; + + return AwsAccessKey; + })(); + + v1.AzureCredentials = (function() { + + /** + * Properties of an AzureCredentials. + * @memberof google.storagetransfer.v1 + * @interface IAzureCredentials + * @property {string|null} [sasToken] AzureCredentials sasToken + */ + + /** + * Constructs a new AzureCredentials. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an AzureCredentials. + * @implements IAzureCredentials + * @constructor + * @param {google.storagetransfer.v1.IAzureCredentials=} [properties] Properties to set + */ + function AzureCredentials(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureCredentials sasToken. + * @member {string} sasToken + * @memberof google.storagetransfer.v1.AzureCredentials + * @instance + */ + AzureCredentials.prototype.sasToken = ""; + + /** + * Creates a new AzureCredentials instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.AzureCredentials + * @static + * @param {google.storagetransfer.v1.IAzureCredentials=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials instance + */ + AzureCredentials.create = function create(properties) { + return new AzureCredentials(properties); + }; + + /** + * Encodes the specified AzureCredentials message. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.AzureCredentials + * @static + * @param {google.storagetransfer.v1.IAzureCredentials} message AzureCredentials message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureCredentials.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sasToken != null && Object.hasOwnProperty.call(message, "sasToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sasToken); + return writer; + }; + + /** + * Encodes the specified AzureCredentials message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureCredentials.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.AzureCredentials + * @static + * @param {google.storagetransfer.v1.IAzureCredentials} message AzureCredentials message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureCredentials.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureCredentials message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.AzureCredentials + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureCredentials.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AzureCredentials(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.sasToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureCredentials message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.AzureCredentials + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureCredentials.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureCredentials message. + * @function verify + * @memberof google.storagetransfer.v1.AzureCredentials + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureCredentials.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sasToken != null && message.hasOwnProperty("sasToken")) + if (!$util.isString(message.sasToken)) + return "sasToken: string expected"; + return null; + }; + + /** + * Creates an AzureCredentials message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.AzureCredentials + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.AzureCredentials} AzureCredentials + */ + AzureCredentials.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AzureCredentials) + return object; + var message = new $root.google.storagetransfer.v1.AzureCredentials(); + if (object.sasToken != null) + message.sasToken = String(object.sasToken); + return message; + }; + + /** + * Creates a plain object from an AzureCredentials message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.AzureCredentials + * @static + * @param {google.storagetransfer.v1.AzureCredentials} message AzureCredentials + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureCredentials.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sasToken = ""; + if (message.sasToken != null && message.hasOwnProperty("sasToken")) + object.sasToken = message.sasToken; + return object; + }; + + /** + * Converts this AzureCredentials to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.AzureCredentials + * @instance + * @returns {Object.} JSON object + */ + AzureCredentials.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureCredentials + * @function getTypeUrl + * @memberof google.storagetransfer.v1.AzureCredentials + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureCredentials.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.AzureCredentials"; + }; + + return AzureCredentials; + })(); + + v1.ObjectConditions = (function() { + + /** + * Properties of an ObjectConditions. + * @memberof google.storagetransfer.v1 + * @interface IObjectConditions + * @property {google.protobuf.IDuration|null} [minTimeElapsedSinceLastModification] ObjectConditions minTimeElapsedSinceLastModification + * @property {google.protobuf.IDuration|null} [maxTimeElapsedSinceLastModification] ObjectConditions maxTimeElapsedSinceLastModification + * @property {Array.|null} [includePrefixes] ObjectConditions includePrefixes + * @property {Array.|null} [excludePrefixes] ObjectConditions excludePrefixes + * @property {google.protobuf.ITimestamp|null} [lastModifiedSince] ObjectConditions lastModifiedSince + * @property {google.protobuf.ITimestamp|null} [lastModifiedBefore] ObjectConditions lastModifiedBefore + */ + + /** + * Constructs a new ObjectConditions. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an ObjectConditions. + * @implements IObjectConditions + * @constructor + * @param {google.storagetransfer.v1.IObjectConditions=} [properties] Properties to set + */ + function ObjectConditions(properties) { + this.includePrefixes = []; + this.excludePrefixes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectConditions minTimeElapsedSinceLastModification. + * @member {google.protobuf.IDuration|null|undefined} minTimeElapsedSinceLastModification + * @memberof google.storagetransfer.v1.ObjectConditions + * @instance + */ + ObjectConditions.prototype.minTimeElapsedSinceLastModification = null; + + /** + * ObjectConditions maxTimeElapsedSinceLastModification. + * @member {google.protobuf.IDuration|null|undefined} maxTimeElapsedSinceLastModification + * @memberof google.storagetransfer.v1.ObjectConditions + * @instance + */ + ObjectConditions.prototype.maxTimeElapsedSinceLastModification = null; + + /** + * ObjectConditions includePrefixes. + * @member {Array.} includePrefixes + * @memberof google.storagetransfer.v1.ObjectConditions + * @instance + */ + ObjectConditions.prototype.includePrefixes = $util.emptyArray; + + /** + * ObjectConditions excludePrefixes. + * @member {Array.} excludePrefixes + * @memberof google.storagetransfer.v1.ObjectConditions + * @instance + */ + ObjectConditions.prototype.excludePrefixes = $util.emptyArray; + + /** + * ObjectConditions lastModifiedSince. + * @member {google.protobuf.ITimestamp|null|undefined} lastModifiedSince + * @memberof google.storagetransfer.v1.ObjectConditions + * @instance + */ + ObjectConditions.prototype.lastModifiedSince = null; + + /** + * ObjectConditions lastModifiedBefore. + * @member {google.protobuf.ITimestamp|null|undefined} lastModifiedBefore + * @memberof google.storagetransfer.v1.ObjectConditions + * @instance + */ + ObjectConditions.prototype.lastModifiedBefore = null; + + /** + * Creates a new ObjectConditions instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.ObjectConditions + * @static + * @param {google.storagetransfer.v1.IObjectConditions=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions instance + */ + ObjectConditions.create = function create(properties) { + return new ObjectConditions(properties); + }; + + /** + * Encodes the specified ObjectConditions message. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.ObjectConditions + * @static + * @param {google.storagetransfer.v1.IObjectConditions} message ObjectConditions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectConditions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minTimeElapsedSinceLastModification != null && Object.hasOwnProperty.call(message, "minTimeElapsedSinceLastModification")) + $root.google.protobuf.Duration.encode(message.minTimeElapsedSinceLastModification, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.maxTimeElapsedSinceLastModification != null && Object.hasOwnProperty.call(message, "maxTimeElapsedSinceLastModification")) + $root.google.protobuf.Duration.encode(message.maxTimeElapsedSinceLastModification, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.includePrefixes != null && message.includePrefixes.length) + for (var i = 0; i < message.includePrefixes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.includePrefixes[i]); + if (message.excludePrefixes != null && message.excludePrefixes.length) + for (var i = 0; i < message.excludePrefixes.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.excludePrefixes[i]); + if (message.lastModifiedSince != null && Object.hasOwnProperty.call(message, "lastModifiedSince")) + $root.google.protobuf.Timestamp.encode(message.lastModifiedSince, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastModifiedBefore != null && Object.hasOwnProperty.call(message, "lastModifiedBefore")) + $root.google.protobuf.Timestamp.encode(message.lastModifiedBefore, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ObjectConditions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ObjectConditions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.ObjectConditions + * @static + * @param {google.storagetransfer.v1.IObjectConditions} message ObjectConditions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectConditions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectConditions message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.ObjectConditions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectConditions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.ObjectConditions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.minTimeElapsedSinceLastModification = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.maxTimeElapsedSinceLastModification = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.includePrefixes && message.includePrefixes.length)) + message.includePrefixes = []; + message.includePrefixes.push(reader.string()); + break; + } + case 4: { + if (!(message.excludePrefixes && message.excludePrefixes.length)) + message.excludePrefixes = []; + message.excludePrefixes.push(reader.string()); + break; + } + case 5: { + message.lastModifiedSince = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.lastModifiedBefore = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectConditions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.ObjectConditions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectConditions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectConditions message. + * @function verify + * @memberof google.storagetransfer.v1.ObjectConditions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectConditions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minTimeElapsedSinceLastModification != null && message.hasOwnProperty("minTimeElapsedSinceLastModification")) { + var error = $root.google.protobuf.Duration.verify(message.minTimeElapsedSinceLastModification); + if (error) + return "minTimeElapsedSinceLastModification." + error; + } + if (message.maxTimeElapsedSinceLastModification != null && message.hasOwnProperty("maxTimeElapsedSinceLastModification")) { + var error = $root.google.protobuf.Duration.verify(message.maxTimeElapsedSinceLastModification); + if (error) + return "maxTimeElapsedSinceLastModification." + error; + } + if (message.includePrefixes != null && message.hasOwnProperty("includePrefixes")) { + if (!Array.isArray(message.includePrefixes)) + return "includePrefixes: array expected"; + for (var i = 0; i < message.includePrefixes.length; ++i) + if (!$util.isString(message.includePrefixes[i])) + return "includePrefixes: string[] expected"; + } + if (message.excludePrefixes != null && message.hasOwnProperty("excludePrefixes")) { + if (!Array.isArray(message.excludePrefixes)) + return "excludePrefixes: array expected"; + for (var i = 0; i < message.excludePrefixes.length; ++i) + if (!$util.isString(message.excludePrefixes[i])) + return "excludePrefixes: string[] expected"; + } + if (message.lastModifiedSince != null && message.hasOwnProperty("lastModifiedSince")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastModifiedSince); + if (error) + return "lastModifiedSince." + error; + } + if (message.lastModifiedBefore != null && message.hasOwnProperty("lastModifiedBefore")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastModifiedBefore); + if (error) + return "lastModifiedBefore." + error; + } + return null; + }; + + /** + * Creates an ObjectConditions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.ObjectConditions + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.ObjectConditions} ObjectConditions + */ + ObjectConditions.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ObjectConditions) + return object; + var message = new $root.google.storagetransfer.v1.ObjectConditions(); + if (object.minTimeElapsedSinceLastModification != null) { + if (typeof object.minTimeElapsedSinceLastModification !== "object") + throw TypeError(".google.storagetransfer.v1.ObjectConditions.minTimeElapsedSinceLastModification: object expected"); + message.minTimeElapsedSinceLastModification = $root.google.protobuf.Duration.fromObject(object.minTimeElapsedSinceLastModification); + } + if (object.maxTimeElapsedSinceLastModification != null) { + if (typeof object.maxTimeElapsedSinceLastModification !== "object") + throw TypeError(".google.storagetransfer.v1.ObjectConditions.maxTimeElapsedSinceLastModification: object expected"); + message.maxTimeElapsedSinceLastModification = $root.google.protobuf.Duration.fromObject(object.maxTimeElapsedSinceLastModification); + } + if (object.includePrefixes) { + if (!Array.isArray(object.includePrefixes)) + throw TypeError(".google.storagetransfer.v1.ObjectConditions.includePrefixes: array expected"); + message.includePrefixes = []; + for (var i = 0; i < object.includePrefixes.length; ++i) + message.includePrefixes[i] = String(object.includePrefixes[i]); + } + if (object.excludePrefixes) { + if (!Array.isArray(object.excludePrefixes)) + throw TypeError(".google.storagetransfer.v1.ObjectConditions.excludePrefixes: array expected"); + message.excludePrefixes = []; + for (var i = 0; i < object.excludePrefixes.length; ++i) + message.excludePrefixes[i] = String(object.excludePrefixes[i]); + } + if (object.lastModifiedSince != null) { + if (typeof object.lastModifiedSince !== "object") + throw TypeError(".google.storagetransfer.v1.ObjectConditions.lastModifiedSince: object expected"); + message.lastModifiedSince = $root.google.protobuf.Timestamp.fromObject(object.lastModifiedSince); + } + if (object.lastModifiedBefore != null) { + if (typeof object.lastModifiedBefore !== "object") + throw TypeError(".google.storagetransfer.v1.ObjectConditions.lastModifiedBefore: object expected"); + message.lastModifiedBefore = $root.google.protobuf.Timestamp.fromObject(object.lastModifiedBefore); + } + return message; + }; + + /** + * Creates a plain object from an ObjectConditions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.ObjectConditions + * @static + * @param {google.storagetransfer.v1.ObjectConditions} message ObjectConditions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectConditions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.includePrefixes = []; + object.excludePrefixes = []; + } + if (options.defaults) { + object.minTimeElapsedSinceLastModification = null; + object.maxTimeElapsedSinceLastModification = null; + object.lastModifiedSince = null; + object.lastModifiedBefore = null; + } + if (message.minTimeElapsedSinceLastModification != null && message.hasOwnProperty("minTimeElapsedSinceLastModification")) + object.minTimeElapsedSinceLastModification = $root.google.protobuf.Duration.toObject(message.minTimeElapsedSinceLastModification, options); + if (message.maxTimeElapsedSinceLastModification != null && message.hasOwnProperty("maxTimeElapsedSinceLastModification")) + object.maxTimeElapsedSinceLastModification = $root.google.protobuf.Duration.toObject(message.maxTimeElapsedSinceLastModification, options); + if (message.includePrefixes && message.includePrefixes.length) { + object.includePrefixes = []; + for (var j = 0; j < message.includePrefixes.length; ++j) + object.includePrefixes[j] = message.includePrefixes[j]; + } + if (message.excludePrefixes && message.excludePrefixes.length) { + object.excludePrefixes = []; + for (var j = 0; j < message.excludePrefixes.length; ++j) + object.excludePrefixes[j] = message.excludePrefixes[j]; + } + if (message.lastModifiedSince != null && message.hasOwnProperty("lastModifiedSince")) + object.lastModifiedSince = $root.google.protobuf.Timestamp.toObject(message.lastModifiedSince, options); + if (message.lastModifiedBefore != null && message.hasOwnProperty("lastModifiedBefore")) + object.lastModifiedBefore = $root.google.protobuf.Timestamp.toObject(message.lastModifiedBefore, options); + return object; + }; + + /** + * Converts this ObjectConditions to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.ObjectConditions + * @instance + * @returns {Object.} JSON object + */ + ObjectConditions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectConditions + * @function getTypeUrl + * @memberof google.storagetransfer.v1.ObjectConditions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectConditions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.ObjectConditions"; + }; + + return ObjectConditions; + })(); + + v1.GcsData = (function() { + + /** + * Properties of a GcsData. + * @memberof google.storagetransfer.v1 + * @interface IGcsData + * @property {string|null} [bucketName] GcsData bucketName + * @property {string|null} [path] GcsData path + */ + + /** + * Constructs a new GcsData. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a GcsData. + * @implements IGcsData + * @constructor + * @param {google.storagetransfer.v1.IGcsData=} [properties] Properties to set + */ + function GcsData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsData bucketName. + * @member {string} bucketName + * @memberof google.storagetransfer.v1.GcsData + * @instance + */ + GcsData.prototype.bucketName = ""; + + /** + * GcsData path. + * @member {string} path + * @memberof google.storagetransfer.v1.GcsData + * @instance + */ + GcsData.prototype.path = ""; + + /** + * Creates a new GcsData instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.GcsData + * @static + * @param {google.storagetransfer.v1.IGcsData=} [properties] Properties to set + * @returns {google.storagetransfer.v1.GcsData} GcsData instance + */ + GcsData.create = function create(properties) { + return new GcsData(properties); + }; + + /** + * Encodes the specified GcsData message. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.GcsData + * @static + * @param {google.storagetransfer.v1.IGcsData} message GcsData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucketName); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.path); + return writer; + }; + + /** + * Encodes the specified GcsData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.GcsData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.GcsData + * @static + * @param {google.storagetransfer.v1.IGcsData} message GcsData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsData message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.GcsData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.GcsData} GcsData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.GcsData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bucketName = reader.string(); + break; + } + case 3: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.GcsData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.GcsData} GcsData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsData message. + * @function verify + * @memberof google.storagetransfer.v1.GcsData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + if (!$util.isString(message.bucketName)) + return "bucketName: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a GcsData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.GcsData + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.GcsData} GcsData + */ + GcsData.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.GcsData) + return object; + var message = new $root.google.storagetransfer.v1.GcsData(); + if (object.bucketName != null) + message.bucketName = String(object.bucketName); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a GcsData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.GcsData + * @static + * @param {google.storagetransfer.v1.GcsData} message GcsData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucketName = ""; + object.path = ""; + } + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + object.bucketName = message.bucketName; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this GcsData to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.GcsData + * @instance + * @returns {Object.} JSON object + */ + GcsData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsData + * @function getTypeUrl + * @memberof google.storagetransfer.v1.GcsData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.GcsData"; + }; + + return GcsData; + })(); + + v1.AwsS3Data = (function() { + + /** + * Properties of an AwsS3Data. + * @memberof google.storagetransfer.v1 + * @interface IAwsS3Data + * @property {string|null} [bucketName] AwsS3Data bucketName + * @property {google.storagetransfer.v1.IAwsAccessKey|null} [awsAccessKey] AwsS3Data awsAccessKey + * @property {string|null} [path] AwsS3Data path + * @property {string|null} [roleArn] AwsS3Data roleArn + */ + + /** + * Constructs a new AwsS3Data. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an AwsS3Data. + * @implements IAwsS3Data + * @constructor + * @param {google.storagetransfer.v1.IAwsS3Data=} [properties] Properties to set + */ + function AwsS3Data(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsS3Data bucketName. + * @member {string} bucketName + * @memberof google.storagetransfer.v1.AwsS3Data + * @instance + */ + AwsS3Data.prototype.bucketName = ""; + + /** + * AwsS3Data awsAccessKey. + * @member {google.storagetransfer.v1.IAwsAccessKey|null|undefined} awsAccessKey + * @memberof google.storagetransfer.v1.AwsS3Data + * @instance + */ + AwsS3Data.prototype.awsAccessKey = null; + + /** + * AwsS3Data path. + * @member {string} path + * @memberof google.storagetransfer.v1.AwsS3Data + * @instance + */ + AwsS3Data.prototype.path = ""; + + /** + * AwsS3Data roleArn. + * @member {string} roleArn + * @memberof google.storagetransfer.v1.AwsS3Data + * @instance + */ + AwsS3Data.prototype.roleArn = ""; + + /** + * Creates a new AwsS3Data instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.AwsS3Data + * @static + * @param {google.storagetransfer.v1.IAwsS3Data=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data instance + */ + AwsS3Data.create = function create(properties) { + return new AwsS3Data(properties); + }; + + /** + * Encodes the specified AwsS3Data message. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.AwsS3Data + * @static + * @param {google.storagetransfer.v1.IAwsS3Data} message AwsS3Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsS3Data.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucketName); + if (message.awsAccessKey != null && Object.hasOwnProperty.call(message, "awsAccessKey")) + $root.google.storagetransfer.v1.AwsAccessKey.encode(message.awsAccessKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.path); + if (message.roleArn != null && Object.hasOwnProperty.call(message, "roleArn")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.roleArn); + return writer; + }; + + /** + * Encodes the specified AwsS3Data message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsS3Data.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.AwsS3Data + * @static + * @param {google.storagetransfer.v1.IAwsS3Data} message AwsS3Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsS3Data.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsS3Data message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.AwsS3Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsS3Data.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AwsS3Data(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bucketName = reader.string(); + break; + } + case 2: { + message.awsAccessKey = $root.google.storagetransfer.v1.AwsAccessKey.decode(reader, reader.uint32()); + break; + } + case 3: { + message.path = reader.string(); + break; + } + case 4: { + message.roleArn = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsS3Data message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.AwsS3Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsS3Data.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsS3Data message. + * @function verify + * @memberof google.storagetransfer.v1.AwsS3Data + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsS3Data.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + if (!$util.isString(message.bucketName)) + return "bucketName: string expected"; + if (message.awsAccessKey != null && message.hasOwnProperty("awsAccessKey")) { + var error = $root.google.storagetransfer.v1.AwsAccessKey.verify(message.awsAccessKey); + if (error) + return "awsAccessKey." + error; + } + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.roleArn != null && message.hasOwnProperty("roleArn")) + if (!$util.isString(message.roleArn)) + return "roleArn: string expected"; + return null; + }; + + /** + * Creates an AwsS3Data message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.AwsS3Data + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.AwsS3Data} AwsS3Data + */ + AwsS3Data.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AwsS3Data) + return object; + var message = new $root.google.storagetransfer.v1.AwsS3Data(); + if (object.bucketName != null) + message.bucketName = String(object.bucketName); + if (object.awsAccessKey != null) { + if (typeof object.awsAccessKey !== "object") + throw TypeError(".google.storagetransfer.v1.AwsS3Data.awsAccessKey: object expected"); + message.awsAccessKey = $root.google.storagetransfer.v1.AwsAccessKey.fromObject(object.awsAccessKey); + } + if (object.path != null) + message.path = String(object.path); + if (object.roleArn != null) + message.roleArn = String(object.roleArn); + return message; + }; + + /** + * Creates a plain object from an AwsS3Data message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.AwsS3Data + * @static + * @param {google.storagetransfer.v1.AwsS3Data} message AwsS3Data + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsS3Data.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucketName = ""; + object.awsAccessKey = null; + object.path = ""; + object.roleArn = ""; + } + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + object.bucketName = message.bucketName; + if (message.awsAccessKey != null && message.hasOwnProperty("awsAccessKey")) + object.awsAccessKey = $root.google.storagetransfer.v1.AwsAccessKey.toObject(message.awsAccessKey, options); + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.roleArn != null && message.hasOwnProperty("roleArn")) + object.roleArn = message.roleArn; + return object; + }; + + /** + * Converts this AwsS3Data to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.AwsS3Data + * @instance + * @returns {Object.} JSON object + */ + AwsS3Data.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsS3Data + * @function getTypeUrl + * @memberof google.storagetransfer.v1.AwsS3Data + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsS3Data.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.AwsS3Data"; + }; + + return AwsS3Data; + })(); + + v1.AzureBlobStorageData = (function() { + + /** + * Properties of an AzureBlobStorageData. + * @memberof google.storagetransfer.v1 + * @interface IAzureBlobStorageData + * @property {string|null} [storageAccount] AzureBlobStorageData storageAccount + * @property {google.storagetransfer.v1.IAzureCredentials|null} [azureCredentials] AzureBlobStorageData azureCredentials + * @property {string|null} [container] AzureBlobStorageData container + * @property {string|null} [path] AzureBlobStorageData path + */ + + /** + * Constructs a new AzureBlobStorageData. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an AzureBlobStorageData. + * @implements IAzureBlobStorageData + * @constructor + * @param {google.storagetransfer.v1.IAzureBlobStorageData=} [properties] Properties to set + */ + function AzureBlobStorageData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AzureBlobStorageData storageAccount. + * @member {string} storageAccount + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @instance + */ + AzureBlobStorageData.prototype.storageAccount = ""; + + /** + * AzureBlobStorageData azureCredentials. + * @member {google.storagetransfer.v1.IAzureCredentials|null|undefined} azureCredentials + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @instance + */ + AzureBlobStorageData.prototype.azureCredentials = null; + + /** + * AzureBlobStorageData container. + * @member {string} container + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @instance + */ + AzureBlobStorageData.prototype.container = ""; + + /** + * AzureBlobStorageData path. + * @member {string} path + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @instance + */ + AzureBlobStorageData.prototype.path = ""; + + /** + * Creates a new AzureBlobStorageData instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @static + * @param {google.storagetransfer.v1.IAzureBlobStorageData=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData instance + */ + AzureBlobStorageData.create = function create(properties) { + return new AzureBlobStorageData(properties); + }; + + /** + * Encodes the specified AzureBlobStorageData message. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @static + * @param {google.storagetransfer.v1.IAzureBlobStorageData} message AzureBlobStorageData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureBlobStorageData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.storageAccount != null && Object.hasOwnProperty.call(message, "storageAccount")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.storageAccount); + if (message.azureCredentials != null && Object.hasOwnProperty.call(message, "azureCredentials")) + $root.google.storagetransfer.v1.AzureCredentials.encode(message.azureCredentials, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.container != null && Object.hasOwnProperty.call(message, "container")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.container); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.path); + return writer; + }; + + /** + * Encodes the specified AzureBlobStorageData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AzureBlobStorageData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @static + * @param {google.storagetransfer.v1.IAzureBlobStorageData} message AzureBlobStorageData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AzureBlobStorageData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AzureBlobStorageData message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureBlobStorageData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AzureBlobStorageData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.storageAccount = reader.string(); + break; + } + case 2: { + message.azureCredentials = $root.google.storagetransfer.v1.AzureCredentials.decode(reader, reader.uint32()); + break; + } + case 4: { + message.container = reader.string(); + break; + } + case 5: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AzureBlobStorageData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AzureBlobStorageData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AzureBlobStorageData message. + * @function verify + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AzureBlobStorageData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.storageAccount != null && message.hasOwnProperty("storageAccount")) + if (!$util.isString(message.storageAccount)) + return "storageAccount: string expected"; + if (message.azureCredentials != null && message.hasOwnProperty("azureCredentials")) { + var error = $root.google.storagetransfer.v1.AzureCredentials.verify(message.azureCredentials); + if (error) + return "azureCredentials." + error; + } + if (message.container != null && message.hasOwnProperty("container")) + if (!$util.isString(message.container)) + return "container: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates an AzureBlobStorageData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.AzureBlobStorageData} AzureBlobStorageData + */ + AzureBlobStorageData.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AzureBlobStorageData) + return object; + var message = new $root.google.storagetransfer.v1.AzureBlobStorageData(); + if (object.storageAccount != null) + message.storageAccount = String(object.storageAccount); + if (object.azureCredentials != null) { + if (typeof object.azureCredentials !== "object") + throw TypeError(".google.storagetransfer.v1.AzureBlobStorageData.azureCredentials: object expected"); + message.azureCredentials = $root.google.storagetransfer.v1.AzureCredentials.fromObject(object.azureCredentials); + } + if (object.container != null) + message.container = String(object.container); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from an AzureBlobStorageData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @static + * @param {google.storagetransfer.v1.AzureBlobStorageData} message AzureBlobStorageData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AzureBlobStorageData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.storageAccount = ""; + object.azureCredentials = null; + object.container = ""; + object.path = ""; + } + if (message.storageAccount != null && message.hasOwnProperty("storageAccount")) + object.storageAccount = message.storageAccount; + if (message.azureCredentials != null && message.hasOwnProperty("azureCredentials")) + object.azureCredentials = $root.google.storagetransfer.v1.AzureCredentials.toObject(message.azureCredentials, options); + if (message.container != null && message.hasOwnProperty("container")) + object.container = message.container; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this AzureBlobStorageData to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @instance + * @returns {Object.} JSON object + */ + AzureBlobStorageData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AzureBlobStorageData + * @function getTypeUrl + * @memberof google.storagetransfer.v1.AzureBlobStorageData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AzureBlobStorageData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.AzureBlobStorageData"; + }; + + return AzureBlobStorageData; + })(); + + v1.HttpData = (function() { + + /** + * Properties of a HttpData. + * @memberof google.storagetransfer.v1 + * @interface IHttpData + * @property {string|null} [listUrl] HttpData listUrl + */ + + /** + * Constructs a new HttpData. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a HttpData. + * @implements IHttpData + * @constructor + * @param {google.storagetransfer.v1.IHttpData=} [properties] Properties to set + */ + function HttpData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpData listUrl. + * @member {string} listUrl + * @memberof google.storagetransfer.v1.HttpData + * @instance + */ + HttpData.prototype.listUrl = ""; + + /** + * Creates a new HttpData instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.HttpData + * @static + * @param {google.storagetransfer.v1.IHttpData=} [properties] Properties to set + * @returns {google.storagetransfer.v1.HttpData} HttpData instance + */ + HttpData.create = function create(properties) { + return new HttpData(properties); + }; + + /** + * Encodes the specified HttpData message. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.HttpData + * @static + * @param {google.storagetransfer.v1.IHttpData} message HttpData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listUrl != null && Object.hasOwnProperty.call(message, "listUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.listUrl); + return writer; + }; + + /** + * Encodes the specified HttpData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.HttpData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.HttpData + * @static + * @param {google.storagetransfer.v1.IHttpData} message HttpData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpData message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.HttpData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.HttpData} HttpData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.HttpData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.listUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.HttpData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.HttpData} HttpData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpData message. + * @function verify + * @memberof google.storagetransfer.v1.HttpData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listUrl != null && message.hasOwnProperty("listUrl")) + if (!$util.isString(message.listUrl)) + return "listUrl: string expected"; + return null; + }; + + /** + * Creates a HttpData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.HttpData + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.HttpData} HttpData + */ + HttpData.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.HttpData) + return object; + var message = new $root.google.storagetransfer.v1.HttpData(); + if (object.listUrl != null) + message.listUrl = String(object.listUrl); + return message; + }; + + /** + * Creates a plain object from a HttpData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.HttpData + * @static + * @param {google.storagetransfer.v1.HttpData} message HttpData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.listUrl = ""; + if (message.listUrl != null && message.hasOwnProperty("listUrl")) + object.listUrl = message.listUrl; + return object; + }; + + /** + * Converts this HttpData to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.HttpData + * @instance + * @returns {Object.} JSON object + */ + HttpData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpData + * @function getTypeUrl + * @memberof google.storagetransfer.v1.HttpData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.HttpData"; + }; + + return HttpData; + })(); + + v1.PosixFilesystem = (function() { + + /** + * Properties of a PosixFilesystem. + * @memberof google.storagetransfer.v1 + * @interface IPosixFilesystem + * @property {string|null} [rootDirectory] PosixFilesystem rootDirectory + */ + + /** + * Constructs a new PosixFilesystem. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a PosixFilesystem. + * @implements IPosixFilesystem + * @constructor + * @param {google.storagetransfer.v1.IPosixFilesystem=} [properties] Properties to set + */ + function PosixFilesystem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PosixFilesystem rootDirectory. + * @member {string} rootDirectory + * @memberof google.storagetransfer.v1.PosixFilesystem + * @instance + */ + PosixFilesystem.prototype.rootDirectory = ""; + + /** + * Creates a new PosixFilesystem instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {google.storagetransfer.v1.IPosixFilesystem=} [properties] Properties to set + * @returns {google.storagetransfer.v1.PosixFilesystem} PosixFilesystem instance + */ + PosixFilesystem.create = function create(properties) { + return new PosixFilesystem(properties); + }; + + /** + * Encodes the specified PosixFilesystem message. Does not implicitly {@link google.storagetransfer.v1.PosixFilesystem.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {google.storagetransfer.v1.IPosixFilesystem} message PosixFilesystem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PosixFilesystem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rootDirectory != null && Object.hasOwnProperty.call(message, "rootDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rootDirectory); + return writer; + }; + + /** + * Encodes the specified PosixFilesystem message, length delimited. Does not implicitly {@link google.storagetransfer.v1.PosixFilesystem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {google.storagetransfer.v1.IPosixFilesystem} message PosixFilesystem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PosixFilesystem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PosixFilesystem message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.PosixFilesystem} PosixFilesystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PosixFilesystem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.PosixFilesystem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rootDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PosixFilesystem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.PosixFilesystem} PosixFilesystem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PosixFilesystem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PosixFilesystem message. + * @function verify + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PosixFilesystem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rootDirectory != null && message.hasOwnProperty("rootDirectory")) + if (!$util.isString(message.rootDirectory)) + return "rootDirectory: string expected"; + return null; + }; + + /** + * Creates a PosixFilesystem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.PosixFilesystem} PosixFilesystem + */ + PosixFilesystem.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.PosixFilesystem) + return object; + var message = new $root.google.storagetransfer.v1.PosixFilesystem(); + if (object.rootDirectory != null) + message.rootDirectory = String(object.rootDirectory); + return message; + }; + + /** + * Creates a plain object from a PosixFilesystem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {google.storagetransfer.v1.PosixFilesystem} message PosixFilesystem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PosixFilesystem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.rootDirectory = ""; + if (message.rootDirectory != null && message.hasOwnProperty("rootDirectory")) + object.rootDirectory = message.rootDirectory; + return object; + }; + + /** + * Converts this PosixFilesystem to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.PosixFilesystem + * @instance + * @returns {Object.} JSON object + */ + PosixFilesystem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PosixFilesystem + * @function getTypeUrl + * @memberof google.storagetransfer.v1.PosixFilesystem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PosixFilesystem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.PosixFilesystem"; + }; + + return PosixFilesystem; + })(); + + v1.AwsS3CompatibleData = (function() { + + /** + * Properties of an AwsS3CompatibleData. + * @memberof google.storagetransfer.v1 + * @interface IAwsS3CompatibleData + * @property {string|null} [bucketName] AwsS3CompatibleData bucketName + * @property {string|null} [path] AwsS3CompatibleData path + * @property {string|null} [endpoint] AwsS3CompatibleData endpoint + * @property {string|null} [region] AwsS3CompatibleData region + * @property {google.storagetransfer.v1.IS3CompatibleMetadata|null} [s3Metadata] AwsS3CompatibleData s3Metadata + */ + + /** + * Constructs a new AwsS3CompatibleData. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an AwsS3CompatibleData. + * @implements IAwsS3CompatibleData + * @constructor + * @param {google.storagetransfer.v1.IAwsS3CompatibleData=} [properties] Properties to set + */ + function AwsS3CompatibleData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwsS3CompatibleData bucketName. + * @member {string} bucketName + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @instance + */ + AwsS3CompatibleData.prototype.bucketName = ""; + + /** + * AwsS3CompatibleData path. + * @member {string} path + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @instance + */ + AwsS3CompatibleData.prototype.path = ""; + + /** + * AwsS3CompatibleData endpoint. + * @member {string} endpoint + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @instance + */ + AwsS3CompatibleData.prototype.endpoint = ""; + + /** + * AwsS3CompatibleData region. + * @member {string} region + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @instance + */ + AwsS3CompatibleData.prototype.region = ""; + + /** + * AwsS3CompatibleData s3Metadata. + * @member {google.storagetransfer.v1.IS3CompatibleMetadata|null|undefined} s3Metadata + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @instance + */ + AwsS3CompatibleData.prototype.s3Metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AwsS3CompatibleData dataProvider. + * @member {"s3Metadata"|undefined} dataProvider + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @instance + */ + Object.defineProperty(AwsS3CompatibleData.prototype, "dataProvider", { + get: $util.oneOfGetter($oneOfFields = ["s3Metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AwsS3CompatibleData instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @static + * @param {google.storagetransfer.v1.IAwsS3CompatibleData=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AwsS3CompatibleData} AwsS3CompatibleData instance + */ + AwsS3CompatibleData.create = function create(properties) { + return new AwsS3CompatibleData(properties); + }; + + /** + * Encodes the specified AwsS3CompatibleData message. Does not implicitly {@link google.storagetransfer.v1.AwsS3CompatibleData.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @static + * @param {google.storagetransfer.v1.IAwsS3CompatibleData} message AwsS3CompatibleData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsS3CompatibleData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucketName); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.endpoint); + if (message.s3Metadata != null && Object.hasOwnProperty.call(message, "s3Metadata")) + $root.google.storagetransfer.v1.S3CompatibleMetadata.encode(message.s3Metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.region); + return writer; + }; + + /** + * Encodes the specified AwsS3CompatibleData message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AwsS3CompatibleData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @static + * @param {google.storagetransfer.v1.IAwsS3CompatibleData} message AwsS3CompatibleData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwsS3CompatibleData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwsS3CompatibleData message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.AwsS3CompatibleData} AwsS3CompatibleData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsS3CompatibleData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AwsS3CompatibleData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bucketName = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + case 3: { + message.endpoint = reader.string(); + break; + } + case 5: { + message.region = reader.string(); + break; + } + case 4: { + message.s3Metadata = $root.google.storagetransfer.v1.S3CompatibleMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AwsS3CompatibleData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.AwsS3CompatibleData} AwsS3CompatibleData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwsS3CompatibleData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwsS3CompatibleData message. + * @function verify + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwsS3CompatibleData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + if (!$util.isString(message.bucketName)) + return "bucketName: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.s3Metadata != null && message.hasOwnProperty("s3Metadata")) { + properties.dataProvider = 1; + { + var error = $root.google.storagetransfer.v1.S3CompatibleMetadata.verify(message.s3Metadata); + if (error) + return "s3Metadata." + error; + } + } + return null; + }; + + /** + * Creates an AwsS3CompatibleData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.AwsS3CompatibleData} AwsS3CompatibleData + */ + AwsS3CompatibleData.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AwsS3CompatibleData) + return object; + var message = new $root.google.storagetransfer.v1.AwsS3CompatibleData(); + if (object.bucketName != null) + message.bucketName = String(object.bucketName); + if (object.path != null) + message.path = String(object.path); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + if (object.region != null) + message.region = String(object.region); + if (object.s3Metadata != null) { + if (typeof object.s3Metadata !== "object") + throw TypeError(".google.storagetransfer.v1.AwsS3CompatibleData.s3Metadata: object expected"); + message.s3Metadata = $root.google.storagetransfer.v1.S3CompatibleMetadata.fromObject(object.s3Metadata); + } + return message; + }; + + /** + * Creates a plain object from an AwsS3CompatibleData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @static + * @param {google.storagetransfer.v1.AwsS3CompatibleData} message AwsS3CompatibleData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwsS3CompatibleData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucketName = ""; + object.path = ""; + object.endpoint = ""; + object.region = ""; + } + if (message.bucketName != null && message.hasOwnProperty("bucketName")) + object.bucketName = message.bucketName; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + if (message.s3Metadata != null && message.hasOwnProperty("s3Metadata")) { + object.s3Metadata = $root.google.storagetransfer.v1.S3CompatibleMetadata.toObject(message.s3Metadata, options); + if (options.oneofs) + object.dataProvider = "s3Metadata"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + return object; + }; + + /** + * Converts this AwsS3CompatibleData to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @instance + * @returns {Object.} JSON object + */ + AwsS3CompatibleData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwsS3CompatibleData + * @function getTypeUrl + * @memberof google.storagetransfer.v1.AwsS3CompatibleData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwsS3CompatibleData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.AwsS3CompatibleData"; + }; + + return AwsS3CompatibleData; + })(); + + v1.S3CompatibleMetadata = (function() { + + /** + * Properties of a S3CompatibleMetadata. + * @memberof google.storagetransfer.v1 + * @interface IS3CompatibleMetadata + * @property {google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod|null} [authMethod] S3CompatibleMetadata authMethod + * @property {google.storagetransfer.v1.S3CompatibleMetadata.RequestModel|null} [requestModel] S3CompatibleMetadata requestModel + * @property {google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol|null} [protocol] S3CompatibleMetadata protocol + * @property {google.storagetransfer.v1.S3CompatibleMetadata.ListApi|null} [listApi] S3CompatibleMetadata listApi + */ + + /** + * Constructs a new S3CompatibleMetadata. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a S3CompatibleMetadata. + * @implements IS3CompatibleMetadata + * @constructor + * @param {google.storagetransfer.v1.IS3CompatibleMetadata=} [properties] Properties to set + */ + function S3CompatibleMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * S3CompatibleMetadata authMethod. + * @member {google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod} authMethod + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @instance + */ + S3CompatibleMetadata.prototype.authMethod = 0; + + /** + * S3CompatibleMetadata requestModel. + * @member {google.storagetransfer.v1.S3CompatibleMetadata.RequestModel} requestModel + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @instance + */ + S3CompatibleMetadata.prototype.requestModel = 0; + + /** + * S3CompatibleMetadata protocol. + * @member {google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol} protocol + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @instance + */ + S3CompatibleMetadata.prototype.protocol = 0; + + /** + * S3CompatibleMetadata listApi. + * @member {google.storagetransfer.v1.S3CompatibleMetadata.ListApi} listApi + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @instance + */ + S3CompatibleMetadata.prototype.listApi = 0; + + /** + * Creates a new S3CompatibleMetadata instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @static + * @param {google.storagetransfer.v1.IS3CompatibleMetadata=} [properties] Properties to set + * @returns {google.storagetransfer.v1.S3CompatibleMetadata} S3CompatibleMetadata instance + */ + S3CompatibleMetadata.create = function create(properties) { + return new S3CompatibleMetadata(properties); + }; + + /** + * Encodes the specified S3CompatibleMetadata message. Does not implicitly {@link google.storagetransfer.v1.S3CompatibleMetadata.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @static + * @param {google.storagetransfer.v1.IS3CompatibleMetadata} message S3CompatibleMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + S3CompatibleMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authMethod != null && Object.hasOwnProperty.call(message, "authMethod")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.authMethod); + if (message.requestModel != null && Object.hasOwnProperty.call(message, "requestModel")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.requestModel); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.protocol); + if (message.listApi != null && Object.hasOwnProperty.call(message, "listApi")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.listApi); + return writer; + }; + + /** + * Encodes the specified S3CompatibleMetadata message, length delimited. Does not implicitly {@link google.storagetransfer.v1.S3CompatibleMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @static + * @param {google.storagetransfer.v1.IS3CompatibleMetadata} message S3CompatibleMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + S3CompatibleMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a S3CompatibleMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.S3CompatibleMetadata} S3CompatibleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + S3CompatibleMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.S3CompatibleMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.authMethod = reader.int32(); + break; + } + case 2: { + message.requestModel = reader.int32(); + break; + } + case 3: { + message.protocol = reader.int32(); + break; + } + case 4: { + message.listApi = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a S3CompatibleMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.S3CompatibleMetadata} S3CompatibleMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + S3CompatibleMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a S3CompatibleMetadata message. + * @function verify + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + S3CompatibleMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authMethod != null && message.hasOwnProperty("authMethod")) + switch (message.authMethod) { + default: + return "authMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.requestModel != null && message.hasOwnProperty("requestModel")) + switch (message.requestModel) { + default: + return "requestModel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) + switch (message.protocol) { + default: + return "protocol: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.listApi != null && message.hasOwnProperty("listApi")) + switch (message.listApi) { + default: + return "listApi: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a S3CompatibleMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.S3CompatibleMetadata} S3CompatibleMetadata + */ + S3CompatibleMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.S3CompatibleMetadata) + return object; + var message = new $root.google.storagetransfer.v1.S3CompatibleMetadata(); + switch (object.authMethod) { + default: + if (typeof object.authMethod === "number") { + message.authMethod = object.authMethod; + break; + } + break; + case "AUTH_METHOD_UNSPECIFIED": + case 0: + message.authMethod = 0; + break; + case "AUTH_METHOD_AWS_SIGNATURE_V4": + case 1: + message.authMethod = 1; + break; + case "AUTH_METHOD_AWS_SIGNATURE_V2": + case 2: + message.authMethod = 2; + break; + } + switch (object.requestModel) { + default: + if (typeof object.requestModel === "number") { + message.requestModel = object.requestModel; + break; + } + break; + case "REQUEST_MODEL_UNSPECIFIED": + case 0: + message.requestModel = 0; + break; + case "REQUEST_MODEL_VIRTUAL_HOSTED_STYLE": + case 1: + message.requestModel = 1; + break; + case "REQUEST_MODEL_PATH_STYLE": + case 2: + message.requestModel = 2; + break; + } + switch (object.protocol) { + default: + if (typeof object.protocol === "number") { + message.protocol = object.protocol; + break; + } + break; + case "NETWORK_PROTOCOL_UNSPECIFIED": + case 0: + message.protocol = 0; + break; + case "NETWORK_PROTOCOL_HTTPS": + case 1: + message.protocol = 1; + break; + case "NETWORK_PROTOCOL_HTTP": + case 2: + message.protocol = 2; + break; + } + switch (object.listApi) { + default: + if (typeof object.listApi === "number") { + message.listApi = object.listApi; + break; + } + break; + case "LIST_API_UNSPECIFIED": + case 0: + message.listApi = 0; + break; + case "LIST_OBJECTS_V2": + case 1: + message.listApi = 1; + break; + case "LIST_OBJECTS": + case 2: + message.listApi = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a S3CompatibleMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @static + * @param {google.storagetransfer.v1.S3CompatibleMetadata} message S3CompatibleMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + S3CompatibleMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.authMethod = options.enums === String ? "AUTH_METHOD_UNSPECIFIED" : 0; + object.requestModel = options.enums === String ? "REQUEST_MODEL_UNSPECIFIED" : 0; + object.protocol = options.enums === String ? "NETWORK_PROTOCOL_UNSPECIFIED" : 0; + object.listApi = options.enums === String ? "LIST_API_UNSPECIFIED" : 0; + } + if (message.authMethod != null && message.hasOwnProperty("authMethod")) + object.authMethod = options.enums === String ? $root.google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod[message.authMethod] === undefined ? message.authMethod : $root.google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod[message.authMethod] : message.authMethod; + if (message.requestModel != null && message.hasOwnProperty("requestModel")) + object.requestModel = options.enums === String ? $root.google.storagetransfer.v1.S3CompatibleMetadata.RequestModel[message.requestModel] === undefined ? message.requestModel : $root.google.storagetransfer.v1.S3CompatibleMetadata.RequestModel[message.requestModel] : message.requestModel; + if (message.protocol != null && message.hasOwnProperty("protocol")) + object.protocol = options.enums === String ? $root.google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol[message.protocol] === undefined ? message.protocol : $root.google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol[message.protocol] : message.protocol; + if (message.listApi != null && message.hasOwnProperty("listApi")) + object.listApi = options.enums === String ? $root.google.storagetransfer.v1.S3CompatibleMetadata.ListApi[message.listApi] === undefined ? message.listApi : $root.google.storagetransfer.v1.S3CompatibleMetadata.ListApi[message.listApi] : message.listApi; + return object; + }; + + /** + * Converts this S3CompatibleMetadata to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @instance + * @returns {Object.} JSON object + */ + S3CompatibleMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for S3CompatibleMetadata + * @function getTypeUrl + * @memberof google.storagetransfer.v1.S3CompatibleMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + S3CompatibleMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.S3CompatibleMetadata"; + }; + + /** + * AuthMethod enum. + * @name google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod + * @enum {number} + * @property {number} AUTH_METHOD_UNSPECIFIED=0 AUTH_METHOD_UNSPECIFIED value + * @property {number} AUTH_METHOD_AWS_SIGNATURE_V4=1 AUTH_METHOD_AWS_SIGNATURE_V4 value + * @property {number} AUTH_METHOD_AWS_SIGNATURE_V2=2 AUTH_METHOD_AWS_SIGNATURE_V2 value + */ + S3CompatibleMetadata.AuthMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTH_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTH_METHOD_AWS_SIGNATURE_V4"] = 1; + values[valuesById[2] = "AUTH_METHOD_AWS_SIGNATURE_V2"] = 2; + return values; + })(); + + /** + * RequestModel enum. + * @name google.storagetransfer.v1.S3CompatibleMetadata.RequestModel + * @enum {number} + * @property {number} REQUEST_MODEL_UNSPECIFIED=0 REQUEST_MODEL_UNSPECIFIED value + * @property {number} REQUEST_MODEL_VIRTUAL_HOSTED_STYLE=1 REQUEST_MODEL_VIRTUAL_HOSTED_STYLE value + * @property {number} REQUEST_MODEL_PATH_STYLE=2 REQUEST_MODEL_PATH_STYLE value + */ + S3CompatibleMetadata.RequestModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REQUEST_MODEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "REQUEST_MODEL_VIRTUAL_HOSTED_STYLE"] = 1; + values[valuesById[2] = "REQUEST_MODEL_PATH_STYLE"] = 2; + return values; + })(); + + /** + * NetworkProtocol enum. + * @name google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol + * @enum {number} + * @property {number} NETWORK_PROTOCOL_UNSPECIFIED=0 NETWORK_PROTOCOL_UNSPECIFIED value + * @property {number} NETWORK_PROTOCOL_HTTPS=1 NETWORK_PROTOCOL_HTTPS value + * @property {number} NETWORK_PROTOCOL_HTTP=2 NETWORK_PROTOCOL_HTTP value + */ + S3CompatibleMetadata.NetworkProtocol = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NETWORK_PROTOCOL_UNSPECIFIED"] = 0; + values[valuesById[1] = "NETWORK_PROTOCOL_HTTPS"] = 1; + values[valuesById[2] = "NETWORK_PROTOCOL_HTTP"] = 2; + return values; + })(); + + /** + * ListApi enum. + * @name google.storagetransfer.v1.S3CompatibleMetadata.ListApi + * @enum {number} + * @property {number} LIST_API_UNSPECIFIED=0 LIST_API_UNSPECIFIED value + * @property {number} LIST_OBJECTS_V2=1 LIST_OBJECTS_V2 value + * @property {number} LIST_OBJECTS=2 LIST_OBJECTS value + */ + S3CompatibleMetadata.ListApi = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIST_API_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIST_OBJECTS_V2"] = 1; + values[valuesById[2] = "LIST_OBJECTS"] = 2; + return values; + })(); + + return S3CompatibleMetadata; + })(); + + v1.AgentPool = (function() { + + /** + * Properties of an AgentPool. + * @memberof google.storagetransfer.v1 + * @interface IAgentPool + * @property {string|null} [name] AgentPool name + * @property {string|null} [displayName] AgentPool displayName + * @property {google.storagetransfer.v1.AgentPool.State|null} [state] AgentPool state + * @property {google.storagetransfer.v1.AgentPool.IBandwidthLimit|null} [bandwidthLimit] AgentPool bandwidthLimit + */ + + /** + * Constructs a new AgentPool. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an AgentPool. + * @implements IAgentPool + * @constructor + * @param {google.storagetransfer.v1.IAgentPool=} [properties] Properties to set + */ + function AgentPool(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentPool name. + * @member {string} name + * @memberof google.storagetransfer.v1.AgentPool + * @instance + */ + AgentPool.prototype.name = ""; + + /** + * AgentPool displayName. + * @member {string} displayName + * @memberof google.storagetransfer.v1.AgentPool + * @instance + */ + AgentPool.prototype.displayName = ""; + + /** + * AgentPool state. + * @member {google.storagetransfer.v1.AgentPool.State} state + * @memberof google.storagetransfer.v1.AgentPool + * @instance + */ + AgentPool.prototype.state = 0; + + /** + * AgentPool bandwidthLimit. + * @member {google.storagetransfer.v1.AgentPool.IBandwidthLimit|null|undefined} bandwidthLimit + * @memberof google.storagetransfer.v1.AgentPool + * @instance + */ + AgentPool.prototype.bandwidthLimit = null; + + /** + * Creates a new AgentPool instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.AgentPool + * @static + * @param {google.storagetransfer.v1.IAgentPool=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AgentPool} AgentPool instance + */ + AgentPool.create = function create(properties) { + return new AgentPool(properties); + }; + + /** + * Encodes the specified AgentPool message. Does not implicitly {@link google.storagetransfer.v1.AgentPool.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.AgentPool + * @static + * @param {google.storagetransfer.v1.IAgentPool} message AgentPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentPool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.bandwidthLimit != null && Object.hasOwnProperty.call(message, "bandwidthLimit")) + $root.google.storagetransfer.v1.AgentPool.BandwidthLimit.encode(message.bandwidthLimit, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AgentPool message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AgentPool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.AgentPool + * @static + * @param {google.storagetransfer.v1.IAgentPool} message AgentPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentPool message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.AgentPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.AgentPool} AgentPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentPool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AgentPool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.bandwidthLimit = $root.google.storagetransfer.v1.AgentPool.BandwidthLimit.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AgentPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.AgentPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.AgentPool} AgentPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentPool message. + * @function verify + * @memberof google.storagetransfer.v1.AgentPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentPool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.bandwidthLimit != null && message.hasOwnProperty("bandwidthLimit")) { + var error = $root.google.storagetransfer.v1.AgentPool.BandwidthLimit.verify(message.bandwidthLimit); + if (error) + return "bandwidthLimit." + error; + } + return null; + }; + + /** + * Creates an AgentPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.AgentPool + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.AgentPool} AgentPool + */ + AgentPool.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AgentPool) + return object; + var message = new $root.google.storagetransfer.v1.AgentPool(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "CREATED": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + } + if (object.bandwidthLimit != null) { + if (typeof object.bandwidthLimit !== "object") + throw TypeError(".google.storagetransfer.v1.AgentPool.bandwidthLimit: object expected"); + message.bandwidthLimit = $root.google.storagetransfer.v1.AgentPool.BandwidthLimit.fromObject(object.bandwidthLimit); + } + return message; + }; + + /** + * Creates a plain object from an AgentPool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.AgentPool + * @static + * @param {google.storagetransfer.v1.AgentPool} message AgentPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.bandwidthLimit = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.storagetransfer.v1.AgentPool.State[message.state] === undefined ? message.state : $root.google.storagetransfer.v1.AgentPool.State[message.state] : message.state; + if (message.bandwidthLimit != null && message.hasOwnProperty("bandwidthLimit")) + object.bandwidthLimit = $root.google.storagetransfer.v1.AgentPool.BandwidthLimit.toObject(message.bandwidthLimit, options); + return object; + }; + + /** + * Converts this AgentPool to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.AgentPool + * @instance + * @returns {Object.} JSON object + */ + AgentPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AgentPool + * @function getTypeUrl + * @memberof google.storagetransfer.v1.AgentPool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AgentPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.AgentPool"; + }; + + /** + * State enum. + * @name google.storagetransfer.v1.AgentPool.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} CREATED=2 CREATED value + * @property {number} DELETING=3 DELETING value + */ + AgentPool.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "CREATED"] = 2; + values[valuesById[3] = "DELETING"] = 3; + return values; + })(); + + AgentPool.BandwidthLimit = (function() { + + /** + * Properties of a BandwidthLimit. + * @memberof google.storagetransfer.v1.AgentPool + * @interface IBandwidthLimit + * @property {number|Long|null} [limitMbps] BandwidthLimit limitMbps + */ + + /** + * Constructs a new BandwidthLimit. + * @memberof google.storagetransfer.v1.AgentPool + * @classdesc Represents a BandwidthLimit. + * @implements IBandwidthLimit + * @constructor + * @param {google.storagetransfer.v1.AgentPool.IBandwidthLimit=} [properties] Properties to set + */ + function BandwidthLimit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BandwidthLimit limitMbps. + * @member {number|Long} limitMbps + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @instance + */ + BandwidthLimit.prototype.limitMbps = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BandwidthLimit instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {google.storagetransfer.v1.AgentPool.IBandwidthLimit=} [properties] Properties to set + * @returns {google.storagetransfer.v1.AgentPool.BandwidthLimit} BandwidthLimit instance + */ + BandwidthLimit.create = function create(properties) { + return new BandwidthLimit(properties); + }; + + /** + * Encodes the specified BandwidthLimit message. Does not implicitly {@link google.storagetransfer.v1.AgentPool.BandwidthLimit.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {google.storagetransfer.v1.AgentPool.IBandwidthLimit} message BandwidthLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BandwidthLimit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.limitMbps != null && Object.hasOwnProperty.call(message, "limitMbps")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.limitMbps); + return writer; + }; + + /** + * Encodes the specified BandwidthLimit message, length delimited. Does not implicitly {@link google.storagetransfer.v1.AgentPool.BandwidthLimit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {google.storagetransfer.v1.AgentPool.IBandwidthLimit} message BandwidthLimit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BandwidthLimit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BandwidthLimit message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.AgentPool.BandwidthLimit} BandwidthLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BandwidthLimit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.AgentPool.BandwidthLimit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.limitMbps = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BandwidthLimit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.AgentPool.BandwidthLimit} BandwidthLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BandwidthLimit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BandwidthLimit message. + * @function verify + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BandwidthLimit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.limitMbps != null && message.hasOwnProperty("limitMbps")) + if (!$util.isInteger(message.limitMbps) && !(message.limitMbps && $util.isInteger(message.limitMbps.low) && $util.isInteger(message.limitMbps.high))) + return "limitMbps: integer|Long expected"; + return null; + }; + + /** + * Creates a BandwidthLimit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.AgentPool.BandwidthLimit} BandwidthLimit + */ + BandwidthLimit.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.AgentPool.BandwidthLimit) + return object; + var message = new $root.google.storagetransfer.v1.AgentPool.BandwidthLimit(); + if (object.limitMbps != null) + if ($util.Long) + (message.limitMbps = $util.Long.fromValue(object.limitMbps)).unsigned = false; + else if (typeof object.limitMbps === "string") + message.limitMbps = parseInt(object.limitMbps, 10); + else if (typeof object.limitMbps === "number") + message.limitMbps = object.limitMbps; + else if (typeof object.limitMbps === "object") + message.limitMbps = new $util.LongBits(object.limitMbps.low >>> 0, object.limitMbps.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BandwidthLimit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {google.storagetransfer.v1.AgentPool.BandwidthLimit} message BandwidthLimit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BandwidthLimit.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.limitMbps = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.limitMbps = options.longs === String ? "0" : 0; + if (message.limitMbps != null && message.hasOwnProperty("limitMbps")) + if (typeof message.limitMbps === "number") + object.limitMbps = options.longs === String ? String(message.limitMbps) : message.limitMbps; + else + object.limitMbps = options.longs === String ? $util.Long.prototype.toString.call(message.limitMbps) : options.longs === Number ? new $util.LongBits(message.limitMbps.low >>> 0, message.limitMbps.high >>> 0).toNumber() : message.limitMbps; + return object; + }; + + /** + * Converts this BandwidthLimit to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @instance + * @returns {Object.} JSON object + */ + BandwidthLimit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BandwidthLimit + * @function getTypeUrl + * @memberof google.storagetransfer.v1.AgentPool.BandwidthLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BandwidthLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.AgentPool.BandwidthLimit"; + }; + + return BandwidthLimit; + })(); + + return AgentPool; + })(); + + v1.TransferOptions = (function() { + + /** + * Properties of a TransferOptions. + * @memberof google.storagetransfer.v1 + * @interface ITransferOptions + * @property {boolean|null} [overwriteObjectsAlreadyExistingInSink] TransferOptions overwriteObjectsAlreadyExistingInSink + * @property {boolean|null} [deleteObjectsUniqueInSink] TransferOptions deleteObjectsUniqueInSink + * @property {boolean|null} [deleteObjectsFromSourceAfterTransfer] TransferOptions deleteObjectsFromSourceAfterTransfer + * @property {google.storagetransfer.v1.TransferOptions.OverwriteWhen|null} [overwriteWhen] TransferOptions overwriteWhen + * @property {google.storagetransfer.v1.IMetadataOptions|null} [metadataOptions] TransferOptions metadataOptions + */ + + /** + * Constructs a new TransferOptions. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a TransferOptions. + * @implements ITransferOptions + * @constructor + * @param {google.storagetransfer.v1.ITransferOptions=} [properties] Properties to set + */ + function TransferOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferOptions overwriteObjectsAlreadyExistingInSink. + * @member {boolean} overwriteObjectsAlreadyExistingInSink + * @memberof google.storagetransfer.v1.TransferOptions + * @instance + */ + TransferOptions.prototype.overwriteObjectsAlreadyExistingInSink = false; + + /** + * TransferOptions deleteObjectsUniqueInSink. + * @member {boolean} deleteObjectsUniqueInSink + * @memberof google.storagetransfer.v1.TransferOptions + * @instance + */ + TransferOptions.prototype.deleteObjectsUniqueInSink = false; + + /** + * TransferOptions deleteObjectsFromSourceAfterTransfer. + * @member {boolean} deleteObjectsFromSourceAfterTransfer + * @memberof google.storagetransfer.v1.TransferOptions + * @instance + */ + TransferOptions.prototype.deleteObjectsFromSourceAfterTransfer = false; + + /** + * TransferOptions overwriteWhen. + * @member {google.storagetransfer.v1.TransferOptions.OverwriteWhen} overwriteWhen + * @memberof google.storagetransfer.v1.TransferOptions + * @instance + */ + TransferOptions.prototype.overwriteWhen = 0; + + /** + * TransferOptions metadataOptions. + * @member {google.storagetransfer.v1.IMetadataOptions|null|undefined} metadataOptions + * @memberof google.storagetransfer.v1.TransferOptions + * @instance + */ + TransferOptions.prototype.metadataOptions = null; + + /** + * Creates a new TransferOptions instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.TransferOptions + * @static + * @param {google.storagetransfer.v1.ITransferOptions=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions instance + */ + TransferOptions.create = function create(properties) { + return new TransferOptions(properties); + }; + + /** + * Encodes the specified TransferOptions message. Does not implicitly {@link google.storagetransfer.v1.TransferOptions.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.TransferOptions + * @static + * @param {google.storagetransfer.v1.ITransferOptions} message TransferOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.overwriteObjectsAlreadyExistingInSink != null && Object.hasOwnProperty.call(message, "overwriteObjectsAlreadyExistingInSink")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.overwriteObjectsAlreadyExistingInSink); + if (message.deleteObjectsUniqueInSink != null && Object.hasOwnProperty.call(message, "deleteObjectsUniqueInSink")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleteObjectsUniqueInSink); + if (message.deleteObjectsFromSourceAfterTransfer != null && Object.hasOwnProperty.call(message, "deleteObjectsFromSourceAfterTransfer")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deleteObjectsFromSourceAfterTransfer); + if (message.overwriteWhen != null && Object.hasOwnProperty.call(message, "overwriteWhen")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.overwriteWhen); + if (message.metadataOptions != null && Object.hasOwnProperty.call(message, "metadataOptions")) + $root.google.storagetransfer.v1.MetadataOptions.encode(message.metadataOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferOptions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.TransferOptions + * @static + * @param {google.storagetransfer.v1.ITransferOptions} message TransferOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferOptions message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.TransferOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.TransferOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.overwriteObjectsAlreadyExistingInSink = reader.bool(); + break; + } + case 2: { + message.deleteObjectsUniqueInSink = reader.bool(); + break; + } + case 3: { + message.deleteObjectsFromSourceAfterTransfer = reader.bool(); + break; + } + case 4: { + message.overwriteWhen = reader.int32(); + break; + } + case 5: { + message.metadataOptions = $root.google.storagetransfer.v1.MetadataOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.TransferOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferOptions message. + * @function verify + * @memberof google.storagetransfer.v1.TransferOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.overwriteObjectsAlreadyExistingInSink != null && message.hasOwnProperty("overwriteObjectsAlreadyExistingInSink")) + if (typeof message.overwriteObjectsAlreadyExistingInSink !== "boolean") + return "overwriteObjectsAlreadyExistingInSink: boolean expected"; + if (message.deleteObjectsUniqueInSink != null && message.hasOwnProperty("deleteObjectsUniqueInSink")) + if (typeof message.deleteObjectsUniqueInSink !== "boolean") + return "deleteObjectsUniqueInSink: boolean expected"; + if (message.deleteObjectsFromSourceAfterTransfer != null && message.hasOwnProperty("deleteObjectsFromSourceAfterTransfer")) + if (typeof message.deleteObjectsFromSourceAfterTransfer !== "boolean") + return "deleteObjectsFromSourceAfterTransfer: boolean expected"; + if (message.overwriteWhen != null && message.hasOwnProperty("overwriteWhen")) + switch (message.overwriteWhen) { + default: + return "overwriteWhen: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.metadataOptions != null && message.hasOwnProperty("metadataOptions")) { + var error = $root.google.storagetransfer.v1.MetadataOptions.verify(message.metadataOptions); + if (error) + return "metadataOptions." + error; + } + return null; + }; + + /** + * Creates a TransferOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.TransferOptions + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.TransferOptions} TransferOptions + */ + TransferOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferOptions) + return object; + var message = new $root.google.storagetransfer.v1.TransferOptions(); + if (object.overwriteObjectsAlreadyExistingInSink != null) + message.overwriteObjectsAlreadyExistingInSink = Boolean(object.overwriteObjectsAlreadyExistingInSink); + if (object.deleteObjectsUniqueInSink != null) + message.deleteObjectsUniqueInSink = Boolean(object.deleteObjectsUniqueInSink); + if (object.deleteObjectsFromSourceAfterTransfer != null) + message.deleteObjectsFromSourceAfterTransfer = Boolean(object.deleteObjectsFromSourceAfterTransfer); + switch (object.overwriteWhen) { + default: + if (typeof object.overwriteWhen === "number") { + message.overwriteWhen = object.overwriteWhen; + break; + } + break; + case "OVERWRITE_WHEN_UNSPECIFIED": + case 0: + message.overwriteWhen = 0; + break; + case "DIFFERENT": + case 1: + message.overwriteWhen = 1; + break; + case "NEVER": + case 2: + message.overwriteWhen = 2; + break; + case "ALWAYS": + case 3: + message.overwriteWhen = 3; + break; + } + if (object.metadataOptions != null) { + if (typeof object.metadataOptions !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOptions.metadataOptions: object expected"); + message.metadataOptions = $root.google.storagetransfer.v1.MetadataOptions.fromObject(object.metadataOptions); + } + return message; + }; + + /** + * Creates a plain object from a TransferOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.TransferOptions + * @static + * @param {google.storagetransfer.v1.TransferOptions} message TransferOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.overwriteObjectsAlreadyExistingInSink = false; + object.deleteObjectsUniqueInSink = false; + object.deleteObjectsFromSourceAfterTransfer = false; + object.overwriteWhen = options.enums === String ? "OVERWRITE_WHEN_UNSPECIFIED" : 0; + object.metadataOptions = null; + } + if (message.overwriteObjectsAlreadyExistingInSink != null && message.hasOwnProperty("overwriteObjectsAlreadyExistingInSink")) + object.overwriteObjectsAlreadyExistingInSink = message.overwriteObjectsAlreadyExistingInSink; + if (message.deleteObjectsUniqueInSink != null && message.hasOwnProperty("deleteObjectsUniqueInSink")) + object.deleteObjectsUniqueInSink = message.deleteObjectsUniqueInSink; + if (message.deleteObjectsFromSourceAfterTransfer != null && message.hasOwnProperty("deleteObjectsFromSourceAfterTransfer")) + object.deleteObjectsFromSourceAfterTransfer = message.deleteObjectsFromSourceAfterTransfer; + if (message.overwriteWhen != null && message.hasOwnProperty("overwriteWhen")) + object.overwriteWhen = options.enums === String ? $root.google.storagetransfer.v1.TransferOptions.OverwriteWhen[message.overwriteWhen] === undefined ? message.overwriteWhen : $root.google.storagetransfer.v1.TransferOptions.OverwriteWhen[message.overwriteWhen] : message.overwriteWhen; + if (message.metadataOptions != null && message.hasOwnProperty("metadataOptions")) + object.metadataOptions = $root.google.storagetransfer.v1.MetadataOptions.toObject(message.metadataOptions, options); + return object; + }; + + /** + * Converts this TransferOptions to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.TransferOptions + * @instance + * @returns {Object.} JSON object + */ + TransferOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferOptions + * @function getTypeUrl + * @memberof google.storagetransfer.v1.TransferOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.TransferOptions"; + }; + + /** + * OverwriteWhen enum. + * @name google.storagetransfer.v1.TransferOptions.OverwriteWhen + * @enum {number} + * @property {number} OVERWRITE_WHEN_UNSPECIFIED=0 OVERWRITE_WHEN_UNSPECIFIED value + * @property {number} DIFFERENT=1 DIFFERENT value + * @property {number} NEVER=2 NEVER value + * @property {number} ALWAYS=3 ALWAYS value + */ + TransferOptions.OverwriteWhen = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OVERWRITE_WHEN_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIFFERENT"] = 1; + values[valuesById[2] = "NEVER"] = 2; + values[valuesById[3] = "ALWAYS"] = 3; + return values; + })(); + + return TransferOptions; + })(); + + v1.TransferSpec = (function() { + + /** + * Properties of a TransferSpec. + * @memberof google.storagetransfer.v1 + * @interface ITransferSpec + * @property {google.storagetransfer.v1.IGcsData|null} [gcsDataSink] TransferSpec gcsDataSink + * @property {google.storagetransfer.v1.IPosixFilesystem|null} [posixDataSink] TransferSpec posixDataSink + * @property {google.storagetransfer.v1.IGcsData|null} [gcsDataSource] TransferSpec gcsDataSource + * @property {google.storagetransfer.v1.IAwsS3Data|null} [awsS3DataSource] TransferSpec awsS3DataSource + * @property {google.storagetransfer.v1.IHttpData|null} [httpDataSource] TransferSpec httpDataSource + * @property {google.storagetransfer.v1.IPosixFilesystem|null} [posixDataSource] TransferSpec posixDataSource + * @property {google.storagetransfer.v1.IAzureBlobStorageData|null} [azureBlobStorageDataSource] TransferSpec azureBlobStorageDataSource + * @property {google.storagetransfer.v1.IAwsS3CompatibleData|null} [awsS3CompatibleDataSource] TransferSpec awsS3CompatibleDataSource + * @property {google.storagetransfer.v1.IGcsData|null} [gcsIntermediateDataLocation] TransferSpec gcsIntermediateDataLocation + * @property {google.storagetransfer.v1.IObjectConditions|null} [objectConditions] TransferSpec objectConditions + * @property {google.storagetransfer.v1.ITransferOptions|null} [transferOptions] TransferSpec transferOptions + * @property {google.storagetransfer.v1.ITransferManifest|null} [transferManifest] TransferSpec transferManifest + * @property {string|null} [sourceAgentPoolName] TransferSpec sourceAgentPoolName + * @property {string|null} [sinkAgentPoolName] TransferSpec sinkAgentPoolName + */ + + /** + * Constructs a new TransferSpec. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a TransferSpec. + * @implements ITransferSpec + * @constructor + * @param {google.storagetransfer.v1.ITransferSpec=} [properties] Properties to set + */ + function TransferSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferSpec gcsDataSink. + * @member {google.storagetransfer.v1.IGcsData|null|undefined} gcsDataSink + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.gcsDataSink = null; + + /** + * TransferSpec posixDataSink. + * @member {google.storagetransfer.v1.IPosixFilesystem|null|undefined} posixDataSink + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.posixDataSink = null; + + /** + * TransferSpec gcsDataSource. + * @member {google.storagetransfer.v1.IGcsData|null|undefined} gcsDataSource + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.gcsDataSource = null; + + /** + * TransferSpec awsS3DataSource. + * @member {google.storagetransfer.v1.IAwsS3Data|null|undefined} awsS3DataSource + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.awsS3DataSource = null; + + /** + * TransferSpec httpDataSource. + * @member {google.storagetransfer.v1.IHttpData|null|undefined} httpDataSource + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.httpDataSource = null; + + /** + * TransferSpec posixDataSource. + * @member {google.storagetransfer.v1.IPosixFilesystem|null|undefined} posixDataSource + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.posixDataSource = null; + + /** + * TransferSpec azureBlobStorageDataSource. + * @member {google.storagetransfer.v1.IAzureBlobStorageData|null|undefined} azureBlobStorageDataSource + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.azureBlobStorageDataSource = null; + + /** + * TransferSpec awsS3CompatibleDataSource. + * @member {google.storagetransfer.v1.IAwsS3CompatibleData|null|undefined} awsS3CompatibleDataSource + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.awsS3CompatibleDataSource = null; + + /** + * TransferSpec gcsIntermediateDataLocation. + * @member {google.storagetransfer.v1.IGcsData|null|undefined} gcsIntermediateDataLocation + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.gcsIntermediateDataLocation = null; + + /** + * TransferSpec objectConditions. + * @member {google.storagetransfer.v1.IObjectConditions|null|undefined} objectConditions + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.objectConditions = null; + + /** + * TransferSpec transferOptions. + * @member {google.storagetransfer.v1.ITransferOptions|null|undefined} transferOptions + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.transferOptions = null; + + /** + * TransferSpec transferManifest. + * @member {google.storagetransfer.v1.ITransferManifest|null|undefined} transferManifest + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.transferManifest = null; + + /** + * TransferSpec sourceAgentPoolName. + * @member {string} sourceAgentPoolName + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.sourceAgentPoolName = ""; + + /** + * TransferSpec sinkAgentPoolName. + * @member {string} sinkAgentPoolName + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + TransferSpec.prototype.sinkAgentPoolName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransferSpec dataSink. + * @member {"gcsDataSink"|"posixDataSink"|undefined} dataSink + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + Object.defineProperty(TransferSpec.prototype, "dataSink", { + get: $util.oneOfGetter($oneOfFields = ["gcsDataSink", "posixDataSink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TransferSpec dataSource. + * @member {"gcsDataSource"|"awsS3DataSource"|"httpDataSource"|"posixDataSource"|"azureBlobStorageDataSource"|"awsS3CompatibleDataSource"|undefined} dataSource + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + Object.defineProperty(TransferSpec.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["gcsDataSource", "awsS3DataSource", "httpDataSource", "posixDataSource", "azureBlobStorageDataSource", "awsS3CompatibleDataSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TransferSpec intermediateDataLocation. + * @member {"gcsIntermediateDataLocation"|undefined} intermediateDataLocation + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + */ + Object.defineProperty(TransferSpec.prototype, "intermediateDataLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsIntermediateDataLocation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransferSpec instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.TransferSpec + * @static + * @param {google.storagetransfer.v1.ITransferSpec=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec instance + */ + TransferSpec.create = function create(properties) { + return new TransferSpec(properties); + }; + + /** + * Encodes the specified TransferSpec message. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.TransferSpec + * @static + * @param {google.storagetransfer.v1.ITransferSpec} message TransferSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDataSource != null && Object.hasOwnProperty.call(message, "gcsDataSource")) + $root.google.storagetransfer.v1.GcsData.encode(message.gcsDataSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.awsS3DataSource != null && Object.hasOwnProperty.call(message, "awsS3DataSource")) + $root.google.storagetransfer.v1.AwsS3Data.encode(message.awsS3DataSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.httpDataSource != null && Object.hasOwnProperty.call(message, "httpDataSource")) + $root.google.storagetransfer.v1.HttpData.encode(message.httpDataSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gcsDataSink != null && Object.hasOwnProperty.call(message, "gcsDataSink")) + $root.google.storagetransfer.v1.GcsData.encode(message.gcsDataSink, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.objectConditions != null && Object.hasOwnProperty.call(message, "objectConditions")) + $root.google.storagetransfer.v1.ObjectConditions.encode(message.objectConditions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.transferOptions != null && Object.hasOwnProperty.call(message, "transferOptions")) + $root.google.storagetransfer.v1.TransferOptions.encode(message.transferOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.azureBlobStorageDataSource != null && Object.hasOwnProperty.call(message, "azureBlobStorageDataSource")) + $root.google.storagetransfer.v1.AzureBlobStorageData.encode(message.azureBlobStorageDataSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.posixDataSink != null && Object.hasOwnProperty.call(message, "posixDataSink")) + $root.google.storagetransfer.v1.PosixFilesystem.encode(message.posixDataSink, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.posixDataSource != null && Object.hasOwnProperty.call(message, "posixDataSource")) + $root.google.storagetransfer.v1.PosixFilesystem.encode(message.posixDataSource, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.transferManifest != null && Object.hasOwnProperty.call(message, "transferManifest")) + $root.google.storagetransfer.v1.TransferManifest.encode(message.transferManifest, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.gcsIntermediateDataLocation != null && Object.hasOwnProperty.call(message, "gcsIntermediateDataLocation")) + $root.google.storagetransfer.v1.GcsData.encode(message.gcsIntermediateDataLocation, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.sourceAgentPoolName != null && Object.hasOwnProperty.call(message, "sourceAgentPoolName")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.sourceAgentPoolName); + if (message.sinkAgentPoolName != null && Object.hasOwnProperty.call(message, "sinkAgentPoolName")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.sinkAgentPoolName); + if (message.awsS3CompatibleDataSource != null && Object.hasOwnProperty.call(message, "awsS3CompatibleDataSource")) + $root.google.storagetransfer.v1.AwsS3CompatibleData.encode(message.awsS3CompatibleDataSource, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferSpec message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.TransferSpec + * @static + * @param {google.storagetransfer.v1.ITransferSpec} message TransferSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferSpec message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.TransferSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.TransferSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.gcsDataSink = $root.google.storagetransfer.v1.GcsData.decode(reader, reader.uint32()); + break; + } + case 13: { + message.posixDataSink = $root.google.storagetransfer.v1.PosixFilesystem.decode(reader, reader.uint32()); + break; + } + case 1: { + message.gcsDataSource = $root.google.storagetransfer.v1.GcsData.decode(reader, reader.uint32()); + break; + } + case 2: { + message.awsS3DataSource = $root.google.storagetransfer.v1.AwsS3Data.decode(reader, reader.uint32()); + break; + } + case 3: { + message.httpDataSource = $root.google.storagetransfer.v1.HttpData.decode(reader, reader.uint32()); + break; + } + case 14: { + message.posixDataSource = $root.google.storagetransfer.v1.PosixFilesystem.decode(reader, reader.uint32()); + break; + } + case 8: { + message.azureBlobStorageDataSource = $root.google.storagetransfer.v1.AzureBlobStorageData.decode(reader, reader.uint32()); + break; + } + case 19: { + message.awsS3CompatibleDataSource = $root.google.storagetransfer.v1.AwsS3CompatibleData.decode(reader, reader.uint32()); + break; + } + case 16: { + message.gcsIntermediateDataLocation = $root.google.storagetransfer.v1.GcsData.decode(reader, reader.uint32()); + break; + } + case 5: { + message.objectConditions = $root.google.storagetransfer.v1.ObjectConditions.decode(reader, reader.uint32()); + break; + } + case 6: { + message.transferOptions = $root.google.storagetransfer.v1.TransferOptions.decode(reader, reader.uint32()); + break; + } + case 15: { + message.transferManifest = $root.google.storagetransfer.v1.TransferManifest.decode(reader, reader.uint32()); + break; + } + case 17: { + message.sourceAgentPoolName = reader.string(); + break; + } + case 18: { + message.sinkAgentPoolName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.TransferSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferSpec message. + * @function verify + * @memberof google.storagetransfer.v1.TransferSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDataSink != null && message.hasOwnProperty("gcsDataSink")) { + properties.dataSink = 1; + { + var error = $root.google.storagetransfer.v1.GcsData.verify(message.gcsDataSink); + if (error) + return "gcsDataSink." + error; + } + } + if (message.posixDataSink != null && message.hasOwnProperty("posixDataSink")) { + if (properties.dataSink === 1) + return "dataSink: multiple values"; + properties.dataSink = 1; + { + var error = $root.google.storagetransfer.v1.PosixFilesystem.verify(message.posixDataSink); + if (error) + return "posixDataSink." + error; + } + } + if (message.gcsDataSource != null && message.hasOwnProperty("gcsDataSource")) { + properties.dataSource = 1; + { + var error = $root.google.storagetransfer.v1.GcsData.verify(message.gcsDataSource); + if (error) + return "gcsDataSource." + error; + } + } + if (message.awsS3DataSource != null && message.hasOwnProperty("awsS3DataSource")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + { + var error = $root.google.storagetransfer.v1.AwsS3Data.verify(message.awsS3DataSource); + if (error) + return "awsS3DataSource." + error; + } + } + if (message.httpDataSource != null && message.hasOwnProperty("httpDataSource")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + { + var error = $root.google.storagetransfer.v1.HttpData.verify(message.httpDataSource); + if (error) + return "httpDataSource." + error; + } + } + if (message.posixDataSource != null && message.hasOwnProperty("posixDataSource")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + { + var error = $root.google.storagetransfer.v1.PosixFilesystem.verify(message.posixDataSource); + if (error) + return "posixDataSource." + error; + } + } + if (message.azureBlobStorageDataSource != null && message.hasOwnProperty("azureBlobStorageDataSource")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + { + var error = $root.google.storagetransfer.v1.AzureBlobStorageData.verify(message.azureBlobStorageDataSource); + if (error) + return "azureBlobStorageDataSource." + error; + } + } + if (message.awsS3CompatibleDataSource != null && message.hasOwnProperty("awsS3CompatibleDataSource")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + { + var error = $root.google.storagetransfer.v1.AwsS3CompatibleData.verify(message.awsS3CompatibleDataSource); + if (error) + return "awsS3CompatibleDataSource." + error; + } + } + if (message.gcsIntermediateDataLocation != null && message.hasOwnProperty("gcsIntermediateDataLocation")) { + properties.intermediateDataLocation = 1; + { + var error = $root.google.storagetransfer.v1.GcsData.verify(message.gcsIntermediateDataLocation); + if (error) + return "gcsIntermediateDataLocation." + error; + } + } + if (message.objectConditions != null && message.hasOwnProperty("objectConditions")) { + var error = $root.google.storagetransfer.v1.ObjectConditions.verify(message.objectConditions); + if (error) + return "objectConditions." + error; + } + if (message.transferOptions != null && message.hasOwnProperty("transferOptions")) { + var error = $root.google.storagetransfer.v1.TransferOptions.verify(message.transferOptions); + if (error) + return "transferOptions." + error; + } + if (message.transferManifest != null && message.hasOwnProperty("transferManifest")) { + var error = $root.google.storagetransfer.v1.TransferManifest.verify(message.transferManifest); + if (error) + return "transferManifest." + error; + } + if (message.sourceAgentPoolName != null && message.hasOwnProperty("sourceAgentPoolName")) + if (!$util.isString(message.sourceAgentPoolName)) + return "sourceAgentPoolName: string expected"; + if (message.sinkAgentPoolName != null && message.hasOwnProperty("sinkAgentPoolName")) + if (!$util.isString(message.sinkAgentPoolName)) + return "sinkAgentPoolName: string expected"; + return null; + }; + + /** + * Creates a TransferSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.TransferSpec + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.TransferSpec} TransferSpec + */ + TransferSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferSpec) + return object; + var message = new $root.google.storagetransfer.v1.TransferSpec(); + if (object.gcsDataSink != null) { + if (typeof object.gcsDataSink !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.gcsDataSink: object expected"); + message.gcsDataSink = $root.google.storagetransfer.v1.GcsData.fromObject(object.gcsDataSink); + } + if (object.posixDataSink != null) { + if (typeof object.posixDataSink !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.posixDataSink: object expected"); + message.posixDataSink = $root.google.storagetransfer.v1.PosixFilesystem.fromObject(object.posixDataSink); + } + if (object.gcsDataSource != null) { + if (typeof object.gcsDataSource !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.gcsDataSource: object expected"); + message.gcsDataSource = $root.google.storagetransfer.v1.GcsData.fromObject(object.gcsDataSource); + } + if (object.awsS3DataSource != null) { + if (typeof object.awsS3DataSource !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.awsS3DataSource: object expected"); + message.awsS3DataSource = $root.google.storagetransfer.v1.AwsS3Data.fromObject(object.awsS3DataSource); + } + if (object.httpDataSource != null) { + if (typeof object.httpDataSource !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.httpDataSource: object expected"); + message.httpDataSource = $root.google.storagetransfer.v1.HttpData.fromObject(object.httpDataSource); + } + if (object.posixDataSource != null) { + if (typeof object.posixDataSource !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.posixDataSource: object expected"); + message.posixDataSource = $root.google.storagetransfer.v1.PosixFilesystem.fromObject(object.posixDataSource); + } + if (object.azureBlobStorageDataSource != null) { + if (typeof object.azureBlobStorageDataSource !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.azureBlobStorageDataSource: object expected"); + message.azureBlobStorageDataSource = $root.google.storagetransfer.v1.AzureBlobStorageData.fromObject(object.azureBlobStorageDataSource); + } + if (object.awsS3CompatibleDataSource != null) { + if (typeof object.awsS3CompatibleDataSource !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.awsS3CompatibleDataSource: object expected"); + message.awsS3CompatibleDataSource = $root.google.storagetransfer.v1.AwsS3CompatibleData.fromObject(object.awsS3CompatibleDataSource); + } + if (object.gcsIntermediateDataLocation != null) { + if (typeof object.gcsIntermediateDataLocation !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.gcsIntermediateDataLocation: object expected"); + message.gcsIntermediateDataLocation = $root.google.storagetransfer.v1.GcsData.fromObject(object.gcsIntermediateDataLocation); + } + if (object.objectConditions != null) { + if (typeof object.objectConditions !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.objectConditions: object expected"); + message.objectConditions = $root.google.storagetransfer.v1.ObjectConditions.fromObject(object.objectConditions); + } + if (object.transferOptions != null) { + if (typeof object.transferOptions !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.transferOptions: object expected"); + message.transferOptions = $root.google.storagetransfer.v1.TransferOptions.fromObject(object.transferOptions); + } + if (object.transferManifest != null) { + if (typeof object.transferManifest !== "object") + throw TypeError(".google.storagetransfer.v1.TransferSpec.transferManifest: object expected"); + message.transferManifest = $root.google.storagetransfer.v1.TransferManifest.fromObject(object.transferManifest); + } + if (object.sourceAgentPoolName != null) + message.sourceAgentPoolName = String(object.sourceAgentPoolName); + if (object.sinkAgentPoolName != null) + message.sinkAgentPoolName = String(object.sinkAgentPoolName); + return message; + }; + + /** + * Creates a plain object from a TransferSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.TransferSpec + * @static + * @param {google.storagetransfer.v1.TransferSpec} message TransferSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.objectConditions = null; + object.transferOptions = null; + object.transferManifest = null; + object.sourceAgentPoolName = ""; + object.sinkAgentPoolName = ""; + } + if (message.gcsDataSource != null && message.hasOwnProperty("gcsDataSource")) { + object.gcsDataSource = $root.google.storagetransfer.v1.GcsData.toObject(message.gcsDataSource, options); + if (options.oneofs) + object.dataSource = "gcsDataSource"; + } + if (message.awsS3DataSource != null && message.hasOwnProperty("awsS3DataSource")) { + object.awsS3DataSource = $root.google.storagetransfer.v1.AwsS3Data.toObject(message.awsS3DataSource, options); + if (options.oneofs) + object.dataSource = "awsS3DataSource"; + } + if (message.httpDataSource != null && message.hasOwnProperty("httpDataSource")) { + object.httpDataSource = $root.google.storagetransfer.v1.HttpData.toObject(message.httpDataSource, options); + if (options.oneofs) + object.dataSource = "httpDataSource"; + } + if (message.gcsDataSink != null && message.hasOwnProperty("gcsDataSink")) { + object.gcsDataSink = $root.google.storagetransfer.v1.GcsData.toObject(message.gcsDataSink, options); + if (options.oneofs) + object.dataSink = "gcsDataSink"; + } + if (message.objectConditions != null && message.hasOwnProperty("objectConditions")) + object.objectConditions = $root.google.storagetransfer.v1.ObjectConditions.toObject(message.objectConditions, options); + if (message.transferOptions != null && message.hasOwnProperty("transferOptions")) + object.transferOptions = $root.google.storagetransfer.v1.TransferOptions.toObject(message.transferOptions, options); + if (message.azureBlobStorageDataSource != null && message.hasOwnProperty("azureBlobStorageDataSource")) { + object.azureBlobStorageDataSource = $root.google.storagetransfer.v1.AzureBlobStorageData.toObject(message.azureBlobStorageDataSource, options); + if (options.oneofs) + object.dataSource = "azureBlobStorageDataSource"; + } + if (message.posixDataSink != null && message.hasOwnProperty("posixDataSink")) { + object.posixDataSink = $root.google.storagetransfer.v1.PosixFilesystem.toObject(message.posixDataSink, options); + if (options.oneofs) + object.dataSink = "posixDataSink"; + } + if (message.posixDataSource != null && message.hasOwnProperty("posixDataSource")) { + object.posixDataSource = $root.google.storagetransfer.v1.PosixFilesystem.toObject(message.posixDataSource, options); + if (options.oneofs) + object.dataSource = "posixDataSource"; + } + if (message.transferManifest != null && message.hasOwnProperty("transferManifest")) + object.transferManifest = $root.google.storagetransfer.v1.TransferManifest.toObject(message.transferManifest, options); + if (message.gcsIntermediateDataLocation != null && message.hasOwnProperty("gcsIntermediateDataLocation")) { + object.gcsIntermediateDataLocation = $root.google.storagetransfer.v1.GcsData.toObject(message.gcsIntermediateDataLocation, options); + if (options.oneofs) + object.intermediateDataLocation = "gcsIntermediateDataLocation"; + } + if (message.sourceAgentPoolName != null && message.hasOwnProperty("sourceAgentPoolName")) + object.sourceAgentPoolName = message.sourceAgentPoolName; + if (message.sinkAgentPoolName != null && message.hasOwnProperty("sinkAgentPoolName")) + object.sinkAgentPoolName = message.sinkAgentPoolName; + if (message.awsS3CompatibleDataSource != null && message.hasOwnProperty("awsS3CompatibleDataSource")) { + object.awsS3CompatibleDataSource = $root.google.storagetransfer.v1.AwsS3CompatibleData.toObject(message.awsS3CompatibleDataSource, options); + if (options.oneofs) + object.dataSource = "awsS3CompatibleDataSource"; + } + return object; + }; + + /** + * Converts this TransferSpec to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.TransferSpec + * @instance + * @returns {Object.} JSON object + */ + TransferSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferSpec + * @function getTypeUrl + * @memberof google.storagetransfer.v1.TransferSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.TransferSpec"; + }; + + return TransferSpec; + })(); + + v1.MetadataOptions = (function() { + + /** + * Properties of a MetadataOptions. + * @memberof google.storagetransfer.v1 + * @interface IMetadataOptions + * @property {google.storagetransfer.v1.MetadataOptions.Symlink|null} [symlink] MetadataOptions symlink + * @property {google.storagetransfer.v1.MetadataOptions.Mode|null} [mode] MetadataOptions mode + * @property {google.storagetransfer.v1.MetadataOptions.GID|null} [gid] MetadataOptions gid + * @property {google.storagetransfer.v1.MetadataOptions.UID|null} [uid] MetadataOptions uid + * @property {google.storagetransfer.v1.MetadataOptions.Acl|null} [acl] MetadataOptions acl + * @property {google.storagetransfer.v1.MetadataOptions.StorageClass|null} [storageClass] MetadataOptions storageClass + * @property {google.storagetransfer.v1.MetadataOptions.TemporaryHold|null} [temporaryHold] MetadataOptions temporaryHold + * @property {google.storagetransfer.v1.MetadataOptions.KmsKey|null} [kmsKey] MetadataOptions kmsKey + * @property {google.storagetransfer.v1.MetadataOptions.TimeCreated|null} [timeCreated] MetadataOptions timeCreated + */ + + /** + * Constructs a new MetadataOptions. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a MetadataOptions. + * @implements IMetadataOptions + * @constructor + * @param {google.storagetransfer.v1.IMetadataOptions=} [properties] Properties to set + */ + function MetadataOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataOptions symlink. + * @member {google.storagetransfer.v1.MetadataOptions.Symlink} symlink + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.symlink = 0; + + /** + * MetadataOptions mode. + * @member {google.storagetransfer.v1.MetadataOptions.Mode} mode + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.mode = 0; + + /** + * MetadataOptions gid. + * @member {google.storagetransfer.v1.MetadataOptions.GID} gid + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.gid = 0; + + /** + * MetadataOptions uid. + * @member {google.storagetransfer.v1.MetadataOptions.UID} uid + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.uid = 0; + + /** + * MetadataOptions acl. + * @member {google.storagetransfer.v1.MetadataOptions.Acl} acl + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.acl = 0; + + /** + * MetadataOptions storageClass. + * @member {google.storagetransfer.v1.MetadataOptions.StorageClass} storageClass + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.storageClass = 0; + + /** + * MetadataOptions temporaryHold. + * @member {google.storagetransfer.v1.MetadataOptions.TemporaryHold} temporaryHold + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.temporaryHold = 0; + + /** + * MetadataOptions kmsKey. + * @member {google.storagetransfer.v1.MetadataOptions.KmsKey} kmsKey + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.kmsKey = 0; + + /** + * MetadataOptions timeCreated. + * @member {google.storagetransfer.v1.MetadataOptions.TimeCreated} timeCreated + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + */ + MetadataOptions.prototype.timeCreated = 0; + + /** + * Creates a new MetadataOptions instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {google.storagetransfer.v1.IMetadataOptions=} [properties] Properties to set + * @returns {google.storagetransfer.v1.MetadataOptions} MetadataOptions instance + */ + MetadataOptions.create = function create(properties) { + return new MetadataOptions(properties); + }; + + /** + * Encodes the specified MetadataOptions message. Does not implicitly {@link google.storagetransfer.v1.MetadataOptions.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {google.storagetransfer.v1.IMetadataOptions} message MetadataOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.symlink != null && Object.hasOwnProperty.call(message, "symlink")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.symlink); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mode); + if (message.gid != null && Object.hasOwnProperty.call(message, "gid")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.gid); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.uid); + if (message.acl != null && Object.hasOwnProperty.call(message, "acl")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.acl); + if (message.storageClass != null && Object.hasOwnProperty.call(message, "storageClass")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.storageClass); + if (message.temporaryHold != null && Object.hasOwnProperty.call(message, "temporaryHold")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.temporaryHold); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.kmsKey); + if (message.timeCreated != null && Object.hasOwnProperty.call(message, "timeCreated")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.timeCreated); + return writer; + }; + + /** + * Encodes the specified MetadataOptions message, length delimited. Does not implicitly {@link google.storagetransfer.v1.MetadataOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {google.storagetransfer.v1.IMetadataOptions} message MetadataOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataOptions message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.MetadataOptions} MetadataOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.MetadataOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.symlink = reader.int32(); + break; + } + case 2: { + message.mode = reader.int32(); + break; + } + case 3: { + message.gid = reader.int32(); + break; + } + case 4: { + message.uid = reader.int32(); + break; + } + case 5: { + message.acl = reader.int32(); + break; + } + case 6: { + message.storageClass = reader.int32(); + break; + } + case 7: { + message.temporaryHold = reader.int32(); + break; + } + case 8: { + message.kmsKey = reader.int32(); + break; + } + case 9: { + message.timeCreated = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.MetadataOptions} MetadataOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataOptions message. + * @function verify + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.symlink != null && message.hasOwnProperty("symlink")) + switch (message.symlink) { + default: + return "symlink: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gid != null && message.hasOwnProperty("gid")) + switch (message.gid) { + default: + return "gid: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uid != null && message.hasOwnProperty("uid")) + switch (message.uid) { + default: + return "uid: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.acl != null && message.hasOwnProperty("acl")) + switch (message.acl) { + default: + return "acl: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.storageClass != null && message.hasOwnProperty("storageClass")) + switch (message.storageClass) { + default: + return "storageClass: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.temporaryHold != null && message.hasOwnProperty("temporaryHold")) + switch (message.temporaryHold) { + default: + return "temporaryHold: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + switch (message.kmsKey) { + default: + return "kmsKey: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.timeCreated != null && message.hasOwnProperty("timeCreated")) + switch (message.timeCreated) { + default: + return "timeCreated: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a MetadataOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.MetadataOptions} MetadataOptions + */ + MetadataOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.MetadataOptions) + return object; + var message = new $root.google.storagetransfer.v1.MetadataOptions(); + switch (object.symlink) { + default: + if (typeof object.symlink === "number") { + message.symlink = object.symlink; + break; + } + break; + case "SYMLINK_UNSPECIFIED": + case 0: + message.symlink = 0; + break; + case "SYMLINK_SKIP": + case 1: + message.symlink = 1; + break; + case "SYMLINK_PRESERVE": + case 2: + message.symlink = 2; + break; + } + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "MODE_SKIP": + case 1: + message.mode = 1; + break; + case "MODE_PRESERVE": + case 2: + message.mode = 2; + break; + } + switch (object.gid) { + default: + if (typeof object.gid === "number") { + message.gid = object.gid; + break; + } + break; + case "GID_UNSPECIFIED": + case 0: + message.gid = 0; + break; + case "GID_SKIP": + case 1: + message.gid = 1; + break; + case "GID_NUMBER": + case 2: + message.gid = 2; + break; + } + switch (object.uid) { + default: + if (typeof object.uid === "number") { + message.uid = object.uid; + break; + } + break; + case "UID_UNSPECIFIED": + case 0: + message.uid = 0; + break; + case "UID_SKIP": + case 1: + message.uid = 1; + break; + case "UID_NUMBER": + case 2: + message.uid = 2; + break; + } + switch (object.acl) { + default: + if (typeof object.acl === "number") { + message.acl = object.acl; + break; + } + break; + case "ACL_UNSPECIFIED": + case 0: + message.acl = 0; + break; + case "ACL_DESTINATION_BUCKET_DEFAULT": + case 1: + message.acl = 1; + break; + case "ACL_PRESERVE": + case 2: + message.acl = 2; + break; + } + switch (object.storageClass) { + default: + if (typeof object.storageClass === "number") { + message.storageClass = object.storageClass; + break; + } + break; + case "STORAGE_CLASS_UNSPECIFIED": + case 0: + message.storageClass = 0; + break; + case "STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT": + case 1: + message.storageClass = 1; + break; + case "STORAGE_CLASS_PRESERVE": + case 2: + message.storageClass = 2; + break; + case "STORAGE_CLASS_STANDARD": + case 3: + message.storageClass = 3; + break; + case "STORAGE_CLASS_NEARLINE": + case 4: + message.storageClass = 4; + break; + case "STORAGE_CLASS_COLDLINE": + case 5: + message.storageClass = 5; + break; + case "STORAGE_CLASS_ARCHIVE": + case 6: + message.storageClass = 6; + break; + } + switch (object.temporaryHold) { + default: + if (typeof object.temporaryHold === "number") { + message.temporaryHold = object.temporaryHold; + break; + } + break; + case "TEMPORARY_HOLD_UNSPECIFIED": + case 0: + message.temporaryHold = 0; + break; + case "TEMPORARY_HOLD_SKIP": + case 1: + message.temporaryHold = 1; + break; + case "TEMPORARY_HOLD_PRESERVE": + case 2: + message.temporaryHold = 2; + break; + } + switch (object.kmsKey) { + default: + if (typeof object.kmsKey === "number") { + message.kmsKey = object.kmsKey; + break; + } + break; + case "KMS_KEY_UNSPECIFIED": + case 0: + message.kmsKey = 0; + break; + case "KMS_KEY_DESTINATION_BUCKET_DEFAULT": + case 1: + message.kmsKey = 1; + break; + case "KMS_KEY_PRESERVE": + case 2: + message.kmsKey = 2; + break; + } + switch (object.timeCreated) { + default: + if (typeof object.timeCreated === "number") { + message.timeCreated = object.timeCreated; + break; + } + break; + case "TIME_CREATED_UNSPECIFIED": + case 0: + message.timeCreated = 0; + break; + case "TIME_CREATED_SKIP": + case 1: + message.timeCreated = 1; + break; + case "TIME_CREATED_PRESERVE_AS_CUSTOM_TIME": + case 2: + message.timeCreated = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a MetadataOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {google.storagetransfer.v1.MetadataOptions} message MetadataOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.symlink = options.enums === String ? "SYMLINK_UNSPECIFIED" : 0; + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + object.gid = options.enums === String ? "GID_UNSPECIFIED" : 0; + object.uid = options.enums === String ? "UID_UNSPECIFIED" : 0; + object.acl = options.enums === String ? "ACL_UNSPECIFIED" : 0; + object.storageClass = options.enums === String ? "STORAGE_CLASS_UNSPECIFIED" : 0; + object.temporaryHold = options.enums === String ? "TEMPORARY_HOLD_UNSPECIFIED" : 0; + object.kmsKey = options.enums === String ? "KMS_KEY_UNSPECIFIED" : 0; + object.timeCreated = options.enums === String ? "TIME_CREATED_UNSPECIFIED" : 0; + } + if (message.symlink != null && message.hasOwnProperty("symlink")) + object.symlink = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.Symlink[message.symlink] === undefined ? message.symlink : $root.google.storagetransfer.v1.MetadataOptions.Symlink[message.symlink] : message.symlink; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.Mode[message.mode] === undefined ? message.mode : $root.google.storagetransfer.v1.MetadataOptions.Mode[message.mode] : message.mode; + if (message.gid != null && message.hasOwnProperty("gid")) + object.gid = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.GID[message.gid] === undefined ? message.gid : $root.google.storagetransfer.v1.MetadataOptions.GID[message.gid] : message.gid; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.UID[message.uid] === undefined ? message.uid : $root.google.storagetransfer.v1.MetadataOptions.UID[message.uid] : message.uid; + if (message.acl != null && message.hasOwnProperty("acl")) + object.acl = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.Acl[message.acl] === undefined ? message.acl : $root.google.storagetransfer.v1.MetadataOptions.Acl[message.acl] : message.acl; + if (message.storageClass != null && message.hasOwnProperty("storageClass")) + object.storageClass = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.StorageClass[message.storageClass] === undefined ? message.storageClass : $root.google.storagetransfer.v1.MetadataOptions.StorageClass[message.storageClass] : message.storageClass; + if (message.temporaryHold != null && message.hasOwnProperty("temporaryHold")) + object.temporaryHold = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.TemporaryHold[message.temporaryHold] === undefined ? message.temporaryHold : $root.google.storagetransfer.v1.MetadataOptions.TemporaryHold[message.temporaryHold] : message.temporaryHold; + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.KmsKey[message.kmsKey] === undefined ? message.kmsKey : $root.google.storagetransfer.v1.MetadataOptions.KmsKey[message.kmsKey] : message.kmsKey; + if (message.timeCreated != null && message.hasOwnProperty("timeCreated")) + object.timeCreated = options.enums === String ? $root.google.storagetransfer.v1.MetadataOptions.TimeCreated[message.timeCreated] === undefined ? message.timeCreated : $root.google.storagetransfer.v1.MetadataOptions.TimeCreated[message.timeCreated] : message.timeCreated; + return object; + }; + + /** + * Converts this MetadataOptions to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.MetadataOptions + * @instance + * @returns {Object.} JSON object + */ + MetadataOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetadataOptions + * @function getTypeUrl + * @memberof google.storagetransfer.v1.MetadataOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetadataOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.MetadataOptions"; + }; + + /** + * Symlink enum. + * @name google.storagetransfer.v1.MetadataOptions.Symlink + * @enum {number} + * @property {number} SYMLINK_UNSPECIFIED=0 SYMLINK_UNSPECIFIED value + * @property {number} SYMLINK_SKIP=1 SYMLINK_SKIP value + * @property {number} SYMLINK_PRESERVE=2 SYMLINK_PRESERVE value + */ + MetadataOptions.Symlink = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SYMLINK_UNSPECIFIED"] = 0; + values[valuesById[1] = "SYMLINK_SKIP"] = 1; + values[valuesById[2] = "SYMLINK_PRESERVE"] = 2; + return values; + })(); + + /** + * Mode enum. + * @name google.storagetransfer.v1.MetadataOptions.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} MODE_SKIP=1 MODE_SKIP value + * @property {number} MODE_PRESERVE=2 MODE_PRESERVE value + */ + MetadataOptions.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODE_SKIP"] = 1; + values[valuesById[2] = "MODE_PRESERVE"] = 2; + return values; + })(); + + /** + * GID enum. + * @name google.storagetransfer.v1.MetadataOptions.GID + * @enum {number} + * @property {number} GID_UNSPECIFIED=0 GID_UNSPECIFIED value + * @property {number} GID_SKIP=1 GID_SKIP value + * @property {number} GID_NUMBER=2 GID_NUMBER value + */ + MetadataOptions.GID = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GID_UNSPECIFIED"] = 0; + values[valuesById[1] = "GID_SKIP"] = 1; + values[valuesById[2] = "GID_NUMBER"] = 2; + return values; + })(); + + /** + * UID enum. + * @name google.storagetransfer.v1.MetadataOptions.UID + * @enum {number} + * @property {number} UID_UNSPECIFIED=0 UID_UNSPECIFIED value + * @property {number} UID_SKIP=1 UID_SKIP value + * @property {number} UID_NUMBER=2 UID_NUMBER value + */ + MetadataOptions.UID = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UID_UNSPECIFIED"] = 0; + values[valuesById[1] = "UID_SKIP"] = 1; + values[valuesById[2] = "UID_NUMBER"] = 2; + return values; + })(); + + /** + * Acl enum. + * @name google.storagetransfer.v1.MetadataOptions.Acl + * @enum {number} + * @property {number} ACL_UNSPECIFIED=0 ACL_UNSPECIFIED value + * @property {number} ACL_DESTINATION_BUCKET_DEFAULT=1 ACL_DESTINATION_BUCKET_DEFAULT value + * @property {number} ACL_PRESERVE=2 ACL_PRESERVE value + */ + MetadataOptions.Acl = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACL_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACL_DESTINATION_BUCKET_DEFAULT"] = 1; + values[valuesById[2] = "ACL_PRESERVE"] = 2; + return values; + })(); + + /** + * StorageClass enum. + * @name google.storagetransfer.v1.MetadataOptions.StorageClass + * @enum {number} + * @property {number} STORAGE_CLASS_UNSPECIFIED=0 STORAGE_CLASS_UNSPECIFIED value + * @property {number} STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT=1 STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT value + * @property {number} STORAGE_CLASS_PRESERVE=2 STORAGE_CLASS_PRESERVE value + * @property {number} STORAGE_CLASS_STANDARD=3 STORAGE_CLASS_STANDARD value + * @property {number} STORAGE_CLASS_NEARLINE=4 STORAGE_CLASS_NEARLINE value + * @property {number} STORAGE_CLASS_COLDLINE=5 STORAGE_CLASS_COLDLINE value + * @property {number} STORAGE_CLASS_ARCHIVE=6 STORAGE_CLASS_ARCHIVE value + */ + MetadataOptions.StorageClass = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STORAGE_CLASS_UNSPECIFIED"] = 0; + values[valuesById[1] = "STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT"] = 1; + values[valuesById[2] = "STORAGE_CLASS_PRESERVE"] = 2; + values[valuesById[3] = "STORAGE_CLASS_STANDARD"] = 3; + values[valuesById[4] = "STORAGE_CLASS_NEARLINE"] = 4; + values[valuesById[5] = "STORAGE_CLASS_COLDLINE"] = 5; + values[valuesById[6] = "STORAGE_CLASS_ARCHIVE"] = 6; + return values; + })(); + + /** + * TemporaryHold enum. + * @name google.storagetransfer.v1.MetadataOptions.TemporaryHold + * @enum {number} + * @property {number} TEMPORARY_HOLD_UNSPECIFIED=0 TEMPORARY_HOLD_UNSPECIFIED value + * @property {number} TEMPORARY_HOLD_SKIP=1 TEMPORARY_HOLD_SKIP value + * @property {number} TEMPORARY_HOLD_PRESERVE=2 TEMPORARY_HOLD_PRESERVE value + */ + MetadataOptions.TemporaryHold = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEMPORARY_HOLD_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEMPORARY_HOLD_SKIP"] = 1; + values[valuesById[2] = "TEMPORARY_HOLD_PRESERVE"] = 2; + return values; + })(); + + /** + * KmsKey enum. + * @name google.storagetransfer.v1.MetadataOptions.KmsKey + * @enum {number} + * @property {number} KMS_KEY_UNSPECIFIED=0 KMS_KEY_UNSPECIFIED value + * @property {number} KMS_KEY_DESTINATION_BUCKET_DEFAULT=1 KMS_KEY_DESTINATION_BUCKET_DEFAULT value + * @property {number} KMS_KEY_PRESERVE=2 KMS_KEY_PRESERVE value + */ + MetadataOptions.KmsKey = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KMS_KEY_UNSPECIFIED"] = 0; + values[valuesById[1] = "KMS_KEY_DESTINATION_BUCKET_DEFAULT"] = 1; + values[valuesById[2] = "KMS_KEY_PRESERVE"] = 2; + return values; + })(); + + /** + * TimeCreated enum. + * @name google.storagetransfer.v1.MetadataOptions.TimeCreated + * @enum {number} + * @property {number} TIME_CREATED_UNSPECIFIED=0 TIME_CREATED_UNSPECIFIED value + * @property {number} TIME_CREATED_SKIP=1 TIME_CREATED_SKIP value + * @property {number} TIME_CREATED_PRESERVE_AS_CUSTOM_TIME=2 TIME_CREATED_PRESERVE_AS_CUSTOM_TIME value + */ + MetadataOptions.TimeCreated = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIME_CREATED_UNSPECIFIED"] = 0; + values[valuesById[1] = "TIME_CREATED_SKIP"] = 1; + values[valuesById[2] = "TIME_CREATED_PRESERVE_AS_CUSTOM_TIME"] = 2; + return values; + })(); + + return MetadataOptions; + })(); + + v1.TransferManifest = (function() { + + /** + * Properties of a TransferManifest. + * @memberof google.storagetransfer.v1 + * @interface ITransferManifest + * @property {string|null} [location] TransferManifest location + */ + + /** + * Constructs a new TransferManifest. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a TransferManifest. + * @implements ITransferManifest + * @constructor + * @param {google.storagetransfer.v1.ITransferManifest=} [properties] Properties to set + */ + function TransferManifest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferManifest location. + * @member {string} location + * @memberof google.storagetransfer.v1.TransferManifest + * @instance + */ + TransferManifest.prototype.location = ""; + + /** + * Creates a new TransferManifest instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {google.storagetransfer.v1.ITransferManifest=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferManifest} TransferManifest instance + */ + TransferManifest.create = function create(properties) { + return new TransferManifest(properties); + }; + + /** + * Encodes the specified TransferManifest message. Does not implicitly {@link google.storagetransfer.v1.TransferManifest.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {google.storagetransfer.v1.ITransferManifest} message TransferManifest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferManifest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + return writer; + }; + + /** + * Encodes the specified TransferManifest message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferManifest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {google.storagetransfer.v1.ITransferManifest} message TransferManifest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferManifest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferManifest message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.TransferManifest} TransferManifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferManifest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.TransferManifest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferManifest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.TransferManifest} TransferManifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferManifest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferManifest message. + * @function verify + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferManifest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a TransferManifest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.TransferManifest} TransferManifest + */ + TransferManifest.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferManifest) + return object; + var message = new $root.google.storagetransfer.v1.TransferManifest(); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a TransferManifest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {google.storagetransfer.v1.TransferManifest} message TransferManifest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferManifest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.location = ""; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this TransferManifest to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.TransferManifest + * @instance + * @returns {Object.} JSON object + */ + TransferManifest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferManifest + * @function getTypeUrl + * @memberof google.storagetransfer.v1.TransferManifest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferManifest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.TransferManifest"; + }; + + return TransferManifest; + })(); + + v1.Schedule = (function() { + + /** + * Properties of a Schedule. + * @memberof google.storagetransfer.v1 + * @interface ISchedule + * @property {google.type.IDate|null} [scheduleStartDate] Schedule scheduleStartDate + * @property {google.type.IDate|null} [scheduleEndDate] Schedule scheduleEndDate + * @property {google.type.ITimeOfDay|null} [startTimeOfDay] Schedule startTimeOfDay + * @property {google.type.ITimeOfDay|null} [endTimeOfDay] Schedule endTimeOfDay + * @property {google.protobuf.IDuration|null} [repeatInterval] Schedule repeatInterval + */ + + /** + * Constructs a new Schedule. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a Schedule. + * @implements ISchedule + * @constructor + * @param {google.storagetransfer.v1.ISchedule=} [properties] Properties to set + */ + function Schedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Schedule scheduleStartDate. + * @member {google.type.IDate|null|undefined} scheduleStartDate + * @memberof google.storagetransfer.v1.Schedule + * @instance + */ + Schedule.prototype.scheduleStartDate = null; + + /** + * Schedule scheduleEndDate. + * @member {google.type.IDate|null|undefined} scheduleEndDate + * @memberof google.storagetransfer.v1.Schedule + * @instance + */ + Schedule.prototype.scheduleEndDate = null; + + /** + * Schedule startTimeOfDay. + * @member {google.type.ITimeOfDay|null|undefined} startTimeOfDay + * @memberof google.storagetransfer.v1.Schedule + * @instance + */ + Schedule.prototype.startTimeOfDay = null; + + /** + * Schedule endTimeOfDay. + * @member {google.type.ITimeOfDay|null|undefined} endTimeOfDay + * @memberof google.storagetransfer.v1.Schedule + * @instance + */ + Schedule.prototype.endTimeOfDay = null; + + /** + * Schedule repeatInterval. + * @member {google.protobuf.IDuration|null|undefined} repeatInterval + * @memberof google.storagetransfer.v1.Schedule + * @instance + */ + Schedule.prototype.repeatInterval = null; + + /** + * Creates a new Schedule instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {google.storagetransfer.v1.ISchedule=} [properties] Properties to set + * @returns {google.storagetransfer.v1.Schedule} Schedule instance + */ + Schedule.create = function create(properties) { + return new Schedule(properties); + }; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.storagetransfer.v1.Schedule.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {google.storagetransfer.v1.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduleStartDate != null && Object.hasOwnProperty.call(message, "scheduleStartDate")) + $root.google.type.Date.encode(message.scheduleStartDate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.scheduleEndDate != null && Object.hasOwnProperty.call(message, "scheduleEndDate")) + $root.google.type.Date.encode(message.scheduleEndDate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTimeOfDay != null && Object.hasOwnProperty.call(message, "startTimeOfDay")) + $root.google.type.TimeOfDay.encode(message.startTimeOfDay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTimeOfDay != null && Object.hasOwnProperty.call(message, "endTimeOfDay")) + $root.google.type.TimeOfDay.encode(message.endTimeOfDay, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.repeatInterval != null && Object.hasOwnProperty.call(message, "repeatInterval")) + $root.google.protobuf.Duration.encode(message.repeatInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.storagetransfer.v1.Schedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {google.storagetransfer.v1.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.Schedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheduleStartDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 2: { + message.scheduleEndDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 3: { + message.startTimeOfDay = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTimeOfDay = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + } + case 5: { + message.repeatInterval = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schedule message. + * @function verify + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduleStartDate != null && message.hasOwnProperty("scheduleStartDate")) { + var error = $root.google.type.Date.verify(message.scheduleStartDate); + if (error) + return "scheduleStartDate." + error; + } + if (message.scheduleEndDate != null && message.hasOwnProperty("scheduleEndDate")) { + var error = $root.google.type.Date.verify(message.scheduleEndDate); + if (error) + return "scheduleEndDate." + error; + } + if (message.startTimeOfDay != null && message.hasOwnProperty("startTimeOfDay")) { + var error = $root.google.type.TimeOfDay.verify(message.startTimeOfDay); + if (error) + return "startTimeOfDay." + error; + } + if (message.endTimeOfDay != null && message.hasOwnProperty("endTimeOfDay")) { + var error = $root.google.type.TimeOfDay.verify(message.endTimeOfDay); + if (error) + return "endTimeOfDay." + error; + } + if (message.repeatInterval != null && message.hasOwnProperty("repeatInterval")) { + var error = $root.google.protobuf.Duration.verify(message.repeatInterval); + if (error) + return "repeatInterval." + error; + } + return null; + }; + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.Schedule} Schedule + */ + Schedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.Schedule) + return object; + var message = new $root.google.storagetransfer.v1.Schedule(); + if (object.scheduleStartDate != null) { + if (typeof object.scheduleStartDate !== "object") + throw TypeError(".google.storagetransfer.v1.Schedule.scheduleStartDate: object expected"); + message.scheduleStartDate = $root.google.type.Date.fromObject(object.scheduleStartDate); + } + if (object.scheduleEndDate != null) { + if (typeof object.scheduleEndDate !== "object") + throw TypeError(".google.storagetransfer.v1.Schedule.scheduleEndDate: object expected"); + message.scheduleEndDate = $root.google.type.Date.fromObject(object.scheduleEndDate); + } + if (object.startTimeOfDay != null) { + if (typeof object.startTimeOfDay !== "object") + throw TypeError(".google.storagetransfer.v1.Schedule.startTimeOfDay: object expected"); + message.startTimeOfDay = $root.google.type.TimeOfDay.fromObject(object.startTimeOfDay); + } + if (object.endTimeOfDay != null) { + if (typeof object.endTimeOfDay !== "object") + throw TypeError(".google.storagetransfer.v1.Schedule.endTimeOfDay: object expected"); + message.endTimeOfDay = $root.google.type.TimeOfDay.fromObject(object.endTimeOfDay); + } + if (object.repeatInterval != null) { + if (typeof object.repeatInterval !== "object") + throw TypeError(".google.storagetransfer.v1.Schedule.repeatInterval: object expected"); + message.repeatInterval = $root.google.protobuf.Duration.fromObject(object.repeatInterval); + } + return message; + }; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {google.storagetransfer.v1.Schedule} message Schedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scheduleStartDate = null; + object.scheduleEndDate = null; + object.startTimeOfDay = null; + object.endTimeOfDay = null; + object.repeatInterval = null; + } + if (message.scheduleStartDate != null && message.hasOwnProperty("scheduleStartDate")) + object.scheduleStartDate = $root.google.type.Date.toObject(message.scheduleStartDate, options); + if (message.scheduleEndDate != null && message.hasOwnProperty("scheduleEndDate")) + object.scheduleEndDate = $root.google.type.Date.toObject(message.scheduleEndDate, options); + if (message.startTimeOfDay != null && message.hasOwnProperty("startTimeOfDay")) + object.startTimeOfDay = $root.google.type.TimeOfDay.toObject(message.startTimeOfDay, options); + if (message.endTimeOfDay != null && message.hasOwnProperty("endTimeOfDay")) + object.endTimeOfDay = $root.google.type.TimeOfDay.toObject(message.endTimeOfDay, options); + if (message.repeatInterval != null && message.hasOwnProperty("repeatInterval")) + object.repeatInterval = $root.google.protobuf.Duration.toObject(message.repeatInterval, options); + return object; + }; + + /** + * Converts this Schedule to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.Schedule + * @instance + * @returns {Object.} JSON object + */ + Schedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schedule + * @function getTypeUrl + * @memberof google.storagetransfer.v1.Schedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.Schedule"; + }; + + return Schedule; + })(); + + v1.TransferJob = (function() { + + /** + * Properties of a TransferJob. + * @memberof google.storagetransfer.v1 + * @interface ITransferJob + * @property {string|null} [name] TransferJob name + * @property {string|null} [description] TransferJob description + * @property {string|null} [projectId] TransferJob projectId + * @property {google.storagetransfer.v1.ITransferSpec|null} [transferSpec] TransferJob transferSpec + * @property {google.storagetransfer.v1.INotificationConfig|null} [notificationConfig] TransferJob notificationConfig + * @property {google.storagetransfer.v1.ILoggingConfig|null} [loggingConfig] TransferJob loggingConfig + * @property {google.storagetransfer.v1.ISchedule|null} [schedule] TransferJob schedule + * @property {google.storagetransfer.v1.TransferJob.Status|null} [status] TransferJob status + * @property {google.protobuf.ITimestamp|null} [creationTime] TransferJob creationTime + * @property {google.protobuf.ITimestamp|null} [lastModificationTime] TransferJob lastModificationTime + * @property {google.protobuf.ITimestamp|null} [deletionTime] TransferJob deletionTime + * @property {string|null} [latestOperationName] TransferJob latestOperationName + */ + + /** + * Constructs a new TransferJob. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a TransferJob. + * @implements ITransferJob + * @constructor + * @param {google.storagetransfer.v1.ITransferJob=} [properties] Properties to set + */ + function TransferJob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferJob name. + * @member {string} name + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.name = ""; + + /** + * TransferJob description. + * @member {string} description + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.description = ""; + + /** + * TransferJob projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.projectId = ""; + + /** + * TransferJob transferSpec. + * @member {google.storagetransfer.v1.ITransferSpec|null|undefined} transferSpec + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.transferSpec = null; + + /** + * TransferJob notificationConfig. + * @member {google.storagetransfer.v1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.notificationConfig = null; + + /** + * TransferJob loggingConfig. + * @member {google.storagetransfer.v1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.loggingConfig = null; + + /** + * TransferJob schedule. + * @member {google.storagetransfer.v1.ISchedule|null|undefined} schedule + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.schedule = null; + + /** + * TransferJob status. + * @member {google.storagetransfer.v1.TransferJob.Status} status + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.status = 0; + + /** + * TransferJob creationTime. + * @member {google.protobuf.ITimestamp|null|undefined} creationTime + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.creationTime = null; + + /** + * TransferJob lastModificationTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastModificationTime + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.lastModificationTime = null; + + /** + * TransferJob deletionTime. + * @member {google.protobuf.ITimestamp|null|undefined} deletionTime + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.deletionTime = null; + + /** + * TransferJob latestOperationName. + * @member {string} latestOperationName + * @memberof google.storagetransfer.v1.TransferJob + * @instance + */ + TransferJob.prototype.latestOperationName = ""; + + /** + * Creates a new TransferJob instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {google.storagetransfer.v1.ITransferJob=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferJob} TransferJob instance + */ + TransferJob.create = function create(properties) { + return new TransferJob(properties); + }; + + /** + * Encodes the specified TransferJob message. Does not implicitly {@link google.storagetransfer.v1.TransferJob.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {google.storagetransfer.v1.ITransferJob} message TransferJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferJob.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectId); + if (message.transferSpec != null && Object.hasOwnProperty.call(message, "transferSpec")) + $root.google.storagetransfer.v1.TransferSpec.encode(message.transferSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.storagetransfer.v1.Schedule.encode(message.schedule, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.status); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + $root.google.protobuf.Timestamp.encode(message.creationTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.lastModificationTime != null && Object.hasOwnProperty.call(message, "lastModificationTime")) + $root.google.protobuf.Timestamp.encode(message.lastModificationTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deletionTime != null && Object.hasOwnProperty.call(message, "deletionTime")) + $root.google.protobuf.Timestamp.encode(message.deletionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.storagetransfer.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.latestOperationName != null && Object.hasOwnProperty.call(message, "latestOperationName")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.latestOperationName); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.storagetransfer.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferJob message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {google.storagetransfer.v1.ITransferJob} message TransferJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferJob message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.TransferJob} TransferJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.TransferJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.projectId = reader.string(); + break; + } + case 4: { + message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.decode(reader, reader.uint32()); + break; + } + case 11: { + message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + message.loggingConfig = $root.google.storagetransfer.v1.LoggingConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.schedule = $root.google.storagetransfer.v1.Schedule.decode(reader, reader.uint32()); + break; + } + case 6: { + message.status = reader.int32(); + break; + } + case 7: { + message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.lastModificationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.deletionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.latestOperationName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.TransferJob} TransferJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferJob message. + * @function verify + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferJob.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) { + var error = $root.google.storagetransfer.v1.TransferSpec.verify(message.transferSpec); + if (error) + return "transferSpec." + error; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.storagetransfer.v1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.storagetransfer.v1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + var error = $root.google.storagetransfer.v1.Schedule.verify(message.schedule); + if (error) + return "schedule." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.creationTime != null && message.hasOwnProperty("creationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.creationTime); + if (error) + return "creationTime." + error; + } + if (message.lastModificationTime != null && message.hasOwnProperty("lastModificationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastModificationTime); + if (error) + return "lastModificationTime." + error; + } + if (message.deletionTime != null && message.hasOwnProperty("deletionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deletionTime); + if (error) + return "deletionTime." + error; + } + if (message.latestOperationName != null && message.hasOwnProperty("latestOperationName")) + if (!$util.isString(message.latestOperationName)) + return "latestOperationName: string expected"; + return null; + }; + + /** + * Creates a TransferJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.TransferJob} TransferJob + */ + TransferJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferJob) + return object; + var message = new $root.google.storagetransfer.v1.TransferJob(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.transferSpec != null) { + if (typeof object.transferSpec !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.transferSpec: object expected"); + message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.fromObject(object.transferSpec); + } + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.notificationConfig: object expected"); + message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.loggingConfig: object expected"); + message.loggingConfig = $root.google.storagetransfer.v1.LoggingConfig.fromObject(object.loggingConfig); + } + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.schedule: object expected"); + message.schedule = $root.google.storagetransfer.v1.Schedule.fromObject(object.schedule); + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "ENABLED": + case 1: + message.status = 1; + break; + case "DISABLED": + case 2: + message.status = 2; + break; + case "DELETED": + case 3: + message.status = 3; + break; + } + if (object.creationTime != null) { + if (typeof object.creationTime !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.creationTime: object expected"); + message.creationTime = $root.google.protobuf.Timestamp.fromObject(object.creationTime); + } + if (object.lastModificationTime != null) { + if (typeof object.lastModificationTime !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.lastModificationTime: object expected"); + message.lastModificationTime = $root.google.protobuf.Timestamp.fromObject(object.lastModificationTime); + } + if (object.deletionTime != null) { + if (typeof object.deletionTime !== "object") + throw TypeError(".google.storagetransfer.v1.TransferJob.deletionTime: object expected"); + message.deletionTime = $root.google.protobuf.Timestamp.fromObject(object.deletionTime); + } + if (object.latestOperationName != null) + message.latestOperationName = String(object.latestOperationName); + return message; + }; + + /** + * Creates a plain object from a TransferJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {google.storagetransfer.v1.TransferJob} message TransferJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.projectId = ""; + object.transferSpec = null; + object.schedule = null; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.creationTime = null; + object.lastModificationTime = null; + object.deletionTime = null; + object.notificationConfig = null; + object.latestOperationName = ""; + object.loggingConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) + object.transferSpec = $root.google.storagetransfer.v1.TransferSpec.toObject(message.transferSpec, options); + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = $root.google.storagetransfer.v1.Schedule.toObject(message.schedule, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.storagetransfer.v1.TransferJob.Status[message.status] === undefined ? message.status : $root.google.storagetransfer.v1.TransferJob.Status[message.status] : message.status; + if (message.creationTime != null && message.hasOwnProperty("creationTime")) + object.creationTime = $root.google.protobuf.Timestamp.toObject(message.creationTime, options); + if (message.lastModificationTime != null && message.hasOwnProperty("lastModificationTime")) + object.lastModificationTime = $root.google.protobuf.Timestamp.toObject(message.lastModificationTime, options); + if (message.deletionTime != null && message.hasOwnProperty("deletionTime")) + object.deletionTime = $root.google.protobuf.Timestamp.toObject(message.deletionTime, options); + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.toObject(message.notificationConfig, options); + if (message.latestOperationName != null && message.hasOwnProperty("latestOperationName")) + object.latestOperationName = message.latestOperationName; + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.storagetransfer.v1.LoggingConfig.toObject(message.loggingConfig, options); + return object; + }; + + /** + * Converts this TransferJob to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.TransferJob + * @instance + * @returns {Object.} JSON object + */ + TransferJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferJob + * @function getTypeUrl + * @memberof google.storagetransfer.v1.TransferJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.TransferJob"; + }; + + /** + * Status enum. + * @name google.storagetransfer.v1.TransferJob.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + * @property {number} DELETED=3 DELETED value + */ + TransferJob.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "DELETED"] = 3; + return values; + })(); + + return TransferJob; + })(); + + v1.ErrorLogEntry = (function() { + + /** + * Properties of an ErrorLogEntry. + * @memberof google.storagetransfer.v1 + * @interface IErrorLogEntry + * @property {string|null} [url] ErrorLogEntry url + * @property {Array.|null} [errorDetails] ErrorLogEntry errorDetails + */ + + /** + * Constructs a new ErrorLogEntry. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an ErrorLogEntry. + * @implements IErrorLogEntry + * @constructor + * @param {google.storagetransfer.v1.IErrorLogEntry=} [properties] Properties to set + */ + function ErrorLogEntry(properties) { + this.errorDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ErrorLogEntry url. + * @member {string} url + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @instance + */ + ErrorLogEntry.prototype.url = ""; + + /** + * ErrorLogEntry errorDetails. + * @member {Array.} errorDetails + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @instance + */ + ErrorLogEntry.prototype.errorDetails = $util.emptyArray; + + /** + * Creates a new ErrorLogEntry instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {google.storagetransfer.v1.IErrorLogEntry=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry instance + */ + ErrorLogEntry.create = function create(properties) { + return new ErrorLogEntry(properties); + }; + + /** + * Encodes the specified ErrorLogEntry message. Does not implicitly {@link google.storagetransfer.v1.ErrorLogEntry.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {google.storagetransfer.v1.IErrorLogEntry} message ErrorLogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorLogEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.errorDetails != null && message.errorDetails.length) + for (var i = 0; i < message.errorDetails.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorDetails[i]); + return writer; + }; + + /** + * Encodes the specified ErrorLogEntry message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ErrorLogEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {google.storagetransfer.v1.IErrorLogEntry} message ErrorLogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorLogEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrorLogEntry message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorLogEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.ErrorLogEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.url = reader.string(); + break; + } + case 3: { + if (!(message.errorDetails && message.errorDetails.length)) + message.errorDetails = []; + message.errorDetails.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorLogEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorLogEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorLogEntry message. + * @function verify + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorLogEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.errorDetails != null && message.hasOwnProperty("errorDetails")) { + if (!Array.isArray(message.errorDetails)) + return "errorDetails: array expected"; + for (var i = 0; i < message.errorDetails.length; ++i) + if (!$util.isString(message.errorDetails[i])) + return "errorDetails: string[] expected"; + } + return null; + }; + + /** + * Creates an ErrorLogEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.ErrorLogEntry} ErrorLogEntry + */ + ErrorLogEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ErrorLogEntry) + return object; + var message = new $root.google.storagetransfer.v1.ErrorLogEntry(); + if (object.url != null) + message.url = String(object.url); + if (object.errorDetails) { + if (!Array.isArray(object.errorDetails)) + throw TypeError(".google.storagetransfer.v1.ErrorLogEntry.errorDetails: array expected"); + message.errorDetails = []; + for (var i = 0; i < object.errorDetails.length; ++i) + message.errorDetails[i] = String(object.errorDetails[i]); + } + return message; + }; + + /** + * Creates a plain object from an ErrorLogEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {google.storagetransfer.v1.ErrorLogEntry} message ErrorLogEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorLogEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorDetails = []; + if (options.defaults) + object.url = ""; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.errorDetails && message.errorDetails.length) { + object.errorDetails = []; + for (var j = 0; j < message.errorDetails.length; ++j) + object.errorDetails[j] = message.errorDetails[j]; + } + return object; + }; + + /** + * Converts this ErrorLogEntry to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @instance + * @returns {Object.} JSON object + */ + ErrorLogEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorLogEntry + * @function getTypeUrl + * @memberof google.storagetransfer.v1.ErrorLogEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorLogEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.ErrorLogEntry"; + }; + + return ErrorLogEntry; + })(); + + v1.ErrorSummary = (function() { + + /** + * Properties of an ErrorSummary. + * @memberof google.storagetransfer.v1 + * @interface IErrorSummary + * @property {google.rpc.Code|null} [errorCode] ErrorSummary errorCode + * @property {number|Long|null} [errorCount] ErrorSummary errorCount + * @property {Array.|null} [errorLogEntries] ErrorSummary errorLogEntries + */ + + /** + * Constructs a new ErrorSummary. + * @memberof google.storagetransfer.v1 + * @classdesc Represents an ErrorSummary. + * @implements IErrorSummary + * @constructor + * @param {google.storagetransfer.v1.IErrorSummary=} [properties] Properties to set + */ + function ErrorSummary(properties) { + this.errorLogEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ErrorSummary errorCode. + * @member {google.rpc.Code} errorCode + * @memberof google.storagetransfer.v1.ErrorSummary + * @instance + */ + ErrorSummary.prototype.errorCode = 0; + + /** + * ErrorSummary errorCount. + * @member {number|Long} errorCount + * @memberof google.storagetransfer.v1.ErrorSummary + * @instance + */ + ErrorSummary.prototype.errorCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ErrorSummary errorLogEntries. + * @member {Array.} errorLogEntries + * @memberof google.storagetransfer.v1.ErrorSummary + * @instance + */ + ErrorSummary.prototype.errorLogEntries = $util.emptyArray; + + /** + * Creates a new ErrorSummary instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {google.storagetransfer.v1.IErrorSummary=} [properties] Properties to set + * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary instance + */ + ErrorSummary.create = function create(properties) { + return new ErrorSummary(properties); + }; + + /** + * Encodes the specified ErrorSummary message. Does not implicitly {@link google.storagetransfer.v1.ErrorSummary.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {google.storagetransfer.v1.IErrorSummary} message ErrorSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorCode); + if (message.errorCount != null && Object.hasOwnProperty.call(message, "errorCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.errorCount); + if (message.errorLogEntries != null && message.errorLogEntries.length) + for (var i = 0; i < message.errorLogEntries.length; ++i) + $root.google.storagetransfer.v1.ErrorLogEntry.encode(message.errorLogEntries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ErrorSummary message, length delimited. Does not implicitly {@link google.storagetransfer.v1.ErrorSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {google.storagetransfer.v1.IErrorSummary} message ErrorSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrorSummary message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.ErrorSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.errorCode = reader.int32(); + break; + } + case 2: { + message.errorCount = reader.int64(); + break; + } + case 3: { + if (!(message.errorLogEntries && message.errorLogEntries.length)) + message.errorLogEntries = []; + message.errorLogEntries.push($root.google.storagetransfer.v1.ErrorLogEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorSummary message. + * @function verify + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + switch (message.errorCode) { + default: + return "errorCode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 16: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + if (!$util.isInteger(message.errorCount) && !(message.errorCount && $util.isInteger(message.errorCount.low) && $util.isInteger(message.errorCount.high))) + return "errorCount: integer|Long expected"; + if (message.errorLogEntries != null && message.hasOwnProperty("errorLogEntries")) { + if (!Array.isArray(message.errorLogEntries)) + return "errorLogEntries: array expected"; + for (var i = 0; i < message.errorLogEntries.length; ++i) { + var error = $root.google.storagetransfer.v1.ErrorLogEntry.verify(message.errorLogEntries[i]); + if (error) + return "errorLogEntries." + error; + } + } + return null; + }; + + /** + * Creates an ErrorSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.ErrorSummary} ErrorSummary + */ + ErrorSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.ErrorSummary) + return object; + var message = new $root.google.storagetransfer.v1.ErrorSummary(); + switch (object.errorCode) { + default: + if (typeof object.errorCode === "number") { + message.errorCode = object.errorCode; + break; + } + break; + case "OK": + case 0: + message.errorCode = 0; + break; + case "CANCELLED": + case 1: + message.errorCode = 1; + break; + case "UNKNOWN": + case 2: + message.errorCode = 2; + break; + case "INVALID_ARGUMENT": + case 3: + message.errorCode = 3; + break; + case "DEADLINE_EXCEEDED": + case 4: + message.errorCode = 4; + break; + case "NOT_FOUND": + case 5: + message.errorCode = 5; + break; + case "ALREADY_EXISTS": + case 6: + message.errorCode = 6; + break; + case "PERMISSION_DENIED": + case 7: + message.errorCode = 7; + break; + case "UNAUTHENTICATED": + case 16: + message.errorCode = 16; + break; + case "RESOURCE_EXHAUSTED": + case 8: + message.errorCode = 8; + break; + case "FAILED_PRECONDITION": + case 9: + message.errorCode = 9; + break; + case "ABORTED": + case 10: + message.errorCode = 10; + break; + case "OUT_OF_RANGE": + case 11: + message.errorCode = 11; + break; + case "UNIMPLEMENTED": + case 12: + message.errorCode = 12; + break; + case "INTERNAL": + case 13: + message.errorCode = 13; + break; + case "UNAVAILABLE": + case 14: + message.errorCode = 14; + break; + case "DATA_LOSS": + case 15: + message.errorCode = 15; + break; + } + if (object.errorCount != null) + if ($util.Long) + (message.errorCount = $util.Long.fromValue(object.errorCount)).unsigned = false; + else if (typeof object.errorCount === "string") + message.errorCount = parseInt(object.errorCount, 10); + else if (typeof object.errorCount === "number") + message.errorCount = object.errorCount; + else if (typeof object.errorCount === "object") + message.errorCount = new $util.LongBits(object.errorCount.low >>> 0, object.errorCount.high >>> 0).toNumber(); + if (object.errorLogEntries) { + if (!Array.isArray(object.errorLogEntries)) + throw TypeError(".google.storagetransfer.v1.ErrorSummary.errorLogEntries: array expected"); + message.errorLogEntries = []; + for (var i = 0; i < object.errorLogEntries.length; ++i) { + if (typeof object.errorLogEntries[i] !== "object") + throw TypeError(".google.storagetransfer.v1.ErrorSummary.errorLogEntries: object expected"); + message.errorLogEntries[i] = $root.google.storagetransfer.v1.ErrorLogEntry.fromObject(object.errorLogEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ErrorSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {google.storagetransfer.v1.ErrorSummary} message ErrorSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorLogEntries = []; + if (options.defaults) { + object.errorCode = options.enums === String ? "OK" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.errorCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.errorCount = options.longs === String ? "0" : 0; + } + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + object.errorCode = options.enums === String ? $root.google.rpc.Code[message.errorCode] === undefined ? message.errorCode : $root.google.rpc.Code[message.errorCode] : message.errorCode; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + if (typeof message.errorCount === "number") + object.errorCount = options.longs === String ? String(message.errorCount) : message.errorCount; + else + object.errorCount = options.longs === String ? $util.Long.prototype.toString.call(message.errorCount) : options.longs === Number ? new $util.LongBits(message.errorCount.low >>> 0, message.errorCount.high >>> 0).toNumber() : message.errorCount; + if (message.errorLogEntries && message.errorLogEntries.length) { + object.errorLogEntries = []; + for (var j = 0; j < message.errorLogEntries.length; ++j) + object.errorLogEntries[j] = $root.google.storagetransfer.v1.ErrorLogEntry.toObject(message.errorLogEntries[j], options); + } + return object; + }; + + /** + * Converts this ErrorSummary to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.ErrorSummary + * @instance + * @returns {Object.} JSON object + */ + ErrorSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorSummary + * @function getTypeUrl + * @memberof google.storagetransfer.v1.ErrorSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.ErrorSummary"; + }; + + return ErrorSummary; + })(); + + v1.TransferCounters = (function() { + + /** + * Properties of a TransferCounters. + * @memberof google.storagetransfer.v1 + * @interface ITransferCounters + * @property {number|Long|null} [objectsFoundFromSource] TransferCounters objectsFoundFromSource + * @property {number|Long|null} [bytesFoundFromSource] TransferCounters bytesFoundFromSource + * @property {number|Long|null} [objectsFoundOnlyFromSink] TransferCounters objectsFoundOnlyFromSink + * @property {number|Long|null} [bytesFoundOnlyFromSink] TransferCounters bytesFoundOnlyFromSink + * @property {number|Long|null} [objectsFromSourceSkippedBySync] TransferCounters objectsFromSourceSkippedBySync + * @property {number|Long|null} [bytesFromSourceSkippedBySync] TransferCounters bytesFromSourceSkippedBySync + * @property {number|Long|null} [objectsCopiedToSink] TransferCounters objectsCopiedToSink + * @property {number|Long|null} [bytesCopiedToSink] TransferCounters bytesCopiedToSink + * @property {number|Long|null} [objectsDeletedFromSource] TransferCounters objectsDeletedFromSource + * @property {number|Long|null} [bytesDeletedFromSource] TransferCounters bytesDeletedFromSource + * @property {number|Long|null} [objectsDeletedFromSink] TransferCounters objectsDeletedFromSink + * @property {number|Long|null} [bytesDeletedFromSink] TransferCounters bytesDeletedFromSink + * @property {number|Long|null} [objectsFromSourceFailed] TransferCounters objectsFromSourceFailed + * @property {number|Long|null} [bytesFromSourceFailed] TransferCounters bytesFromSourceFailed + * @property {number|Long|null} [objectsFailedToDeleteFromSink] TransferCounters objectsFailedToDeleteFromSink + * @property {number|Long|null} [bytesFailedToDeleteFromSink] TransferCounters bytesFailedToDeleteFromSink + * @property {number|Long|null} [directoriesFoundFromSource] TransferCounters directoriesFoundFromSource + * @property {number|Long|null} [directoriesFailedToListFromSource] TransferCounters directoriesFailedToListFromSource + * @property {number|Long|null} [directoriesSuccessfullyListedFromSource] TransferCounters directoriesSuccessfullyListedFromSource + * @property {number|Long|null} [intermediateObjectsCleanedUp] TransferCounters intermediateObjectsCleanedUp + * @property {number|Long|null} [intermediateObjectsFailedCleanedUp] TransferCounters intermediateObjectsFailedCleanedUp + */ + + /** + * Constructs a new TransferCounters. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a TransferCounters. + * @implements ITransferCounters + * @constructor + * @param {google.storagetransfer.v1.ITransferCounters=} [properties] Properties to set + */ + function TransferCounters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferCounters objectsFoundFromSource. + * @member {number|Long} objectsFoundFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsFoundFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesFoundFromSource. + * @member {number|Long} bytesFoundFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesFoundFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsFoundOnlyFromSink. + * @member {number|Long} objectsFoundOnlyFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsFoundOnlyFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesFoundOnlyFromSink. + * @member {number|Long} bytesFoundOnlyFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesFoundOnlyFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsFromSourceSkippedBySync. + * @member {number|Long} objectsFromSourceSkippedBySync + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsFromSourceSkippedBySync = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesFromSourceSkippedBySync. + * @member {number|Long} bytesFromSourceSkippedBySync + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesFromSourceSkippedBySync = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsCopiedToSink. + * @member {number|Long} objectsCopiedToSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsCopiedToSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesCopiedToSink. + * @member {number|Long} bytesCopiedToSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesCopiedToSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsDeletedFromSource. + * @member {number|Long} objectsDeletedFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsDeletedFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesDeletedFromSource. + * @member {number|Long} bytesDeletedFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesDeletedFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsDeletedFromSink. + * @member {number|Long} objectsDeletedFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsDeletedFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesDeletedFromSink. + * @member {number|Long} bytesDeletedFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesDeletedFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsFromSourceFailed. + * @member {number|Long} objectsFromSourceFailed + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsFromSourceFailed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesFromSourceFailed. + * @member {number|Long} bytesFromSourceFailed + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesFromSourceFailed = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsFailedToDeleteFromSink. + * @member {number|Long} objectsFailedToDeleteFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsFailedToDeleteFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesFailedToDeleteFromSink. + * @member {number|Long} bytesFailedToDeleteFromSink + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesFailedToDeleteFromSink = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters directoriesFoundFromSource. + * @member {number|Long} directoriesFoundFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.directoriesFoundFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters directoriesFailedToListFromSource. + * @member {number|Long} directoriesFailedToListFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.directoriesFailedToListFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters directoriesSuccessfullyListedFromSource. + * @member {number|Long} directoriesSuccessfullyListedFromSource + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.directoriesSuccessfullyListedFromSource = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters intermediateObjectsCleanedUp. + * @member {number|Long} intermediateObjectsCleanedUp + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.intermediateObjectsCleanedUp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters intermediateObjectsFailedCleanedUp. + * @member {number|Long} intermediateObjectsFailedCleanedUp + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.intermediateObjectsFailedCleanedUp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TransferCounters instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {google.storagetransfer.v1.ITransferCounters=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters instance + */ + TransferCounters.create = function create(properties) { + return new TransferCounters(properties); + }; + + /** + * Encodes the specified TransferCounters message. Does not implicitly {@link google.storagetransfer.v1.TransferCounters.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {google.storagetransfer.v1.ITransferCounters} message TransferCounters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferCounters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objectsFoundFromSource != null && Object.hasOwnProperty.call(message, "objectsFoundFromSource")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.objectsFoundFromSource); + if (message.bytesFoundFromSource != null && Object.hasOwnProperty.call(message, "bytesFoundFromSource")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.bytesFoundFromSource); + if (message.objectsFoundOnlyFromSink != null && Object.hasOwnProperty.call(message, "objectsFoundOnlyFromSink")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.objectsFoundOnlyFromSink); + if (message.bytesFoundOnlyFromSink != null && Object.hasOwnProperty.call(message, "bytesFoundOnlyFromSink")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bytesFoundOnlyFromSink); + if (message.objectsFromSourceSkippedBySync != null && Object.hasOwnProperty.call(message, "objectsFromSourceSkippedBySync")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.objectsFromSourceSkippedBySync); + if (message.bytesFromSourceSkippedBySync != null && Object.hasOwnProperty.call(message, "bytesFromSourceSkippedBySync")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.bytesFromSourceSkippedBySync); + if (message.objectsCopiedToSink != null && Object.hasOwnProperty.call(message, "objectsCopiedToSink")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.objectsCopiedToSink); + if (message.bytesCopiedToSink != null && Object.hasOwnProperty.call(message, "bytesCopiedToSink")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.bytesCopiedToSink); + if (message.objectsDeletedFromSource != null && Object.hasOwnProperty.call(message, "objectsDeletedFromSource")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.objectsDeletedFromSource); + if (message.bytesDeletedFromSource != null && Object.hasOwnProperty.call(message, "bytesDeletedFromSource")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.bytesDeletedFromSource); + if (message.objectsDeletedFromSink != null && Object.hasOwnProperty.call(message, "objectsDeletedFromSink")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.objectsDeletedFromSink); + if (message.bytesDeletedFromSink != null && Object.hasOwnProperty.call(message, "bytesDeletedFromSink")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.bytesDeletedFromSink); + if (message.objectsFromSourceFailed != null && Object.hasOwnProperty.call(message, "objectsFromSourceFailed")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.objectsFromSourceFailed); + if (message.bytesFromSourceFailed != null && Object.hasOwnProperty.call(message, "bytesFromSourceFailed")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.bytesFromSourceFailed); + if (message.objectsFailedToDeleteFromSink != null && Object.hasOwnProperty.call(message, "objectsFailedToDeleteFromSink")) + writer.uint32(/* id 15, wireType 0 =*/120).int64(message.objectsFailedToDeleteFromSink); + if (message.bytesFailedToDeleteFromSink != null && Object.hasOwnProperty.call(message, "bytesFailedToDeleteFromSink")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.bytesFailedToDeleteFromSink); + if (message.directoriesFoundFromSource != null && Object.hasOwnProperty.call(message, "directoriesFoundFromSource")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.directoriesFoundFromSource); + if (message.directoriesFailedToListFromSource != null && Object.hasOwnProperty.call(message, "directoriesFailedToListFromSource")) + writer.uint32(/* id 18, wireType 0 =*/144).int64(message.directoriesFailedToListFromSource); + if (message.directoriesSuccessfullyListedFromSource != null && Object.hasOwnProperty.call(message, "directoriesSuccessfullyListedFromSource")) + writer.uint32(/* id 19, wireType 0 =*/152).int64(message.directoriesSuccessfullyListedFromSource); + if (message.intermediateObjectsCleanedUp != null && Object.hasOwnProperty.call(message, "intermediateObjectsCleanedUp")) + writer.uint32(/* id 22, wireType 0 =*/176).int64(message.intermediateObjectsCleanedUp); + if (message.intermediateObjectsFailedCleanedUp != null && Object.hasOwnProperty.call(message, "intermediateObjectsFailedCleanedUp")) + writer.uint32(/* id 23, wireType 0 =*/184).int64(message.intermediateObjectsFailedCleanedUp); + return writer; + }; + + /** + * Encodes the specified TransferCounters message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferCounters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {google.storagetransfer.v1.ITransferCounters} message TransferCounters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferCounters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferCounters message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferCounters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.TransferCounters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.objectsFoundFromSource = reader.int64(); + break; + } + case 2: { + message.bytesFoundFromSource = reader.int64(); + break; + } + case 3: { + message.objectsFoundOnlyFromSink = reader.int64(); + break; + } + case 4: { + message.bytesFoundOnlyFromSink = reader.int64(); + break; + } + case 5: { + message.objectsFromSourceSkippedBySync = reader.int64(); + break; + } + case 6: { + message.bytesFromSourceSkippedBySync = reader.int64(); + break; + } + case 7: { + message.objectsCopiedToSink = reader.int64(); + break; + } + case 8: { + message.bytesCopiedToSink = reader.int64(); + break; + } + case 9: { + message.objectsDeletedFromSource = reader.int64(); + break; + } + case 10: { + message.bytesDeletedFromSource = reader.int64(); + break; + } + case 11: { + message.objectsDeletedFromSink = reader.int64(); + break; + } + case 12: { + message.bytesDeletedFromSink = reader.int64(); + break; + } + case 13: { + message.objectsFromSourceFailed = reader.int64(); + break; + } + case 14: { + message.bytesFromSourceFailed = reader.int64(); + break; + } + case 15: { + message.objectsFailedToDeleteFromSink = reader.int64(); + break; + } + case 16: { + message.bytesFailedToDeleteFromSink = reader.int64(); + break; + } + case 17: { + message.directoriesFoundFromSource = reader.int64(); + break; + } + case 18: { + message.directoriesFailedToListFromSource = reader.int64(); + break; + } + case 19: { + message.directoriesSuccessfullyListedFromSource = reader.int64(); + break; + } + case 22: { + message.intermediateObjectsCleanedUp = reader.int64(); + break; + } + case 23: { + message.intermediateObjectsFailedCleanedUp = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferCounters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferCounters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferCounters message. + * @function verify + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferCounters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objectsFoundFromSource != null && message.hasOwnProperty("objectsFoundFromSource")) + if (!$util.isInteger(message.objectsFoundFromSource) && !(message.objectsFoundFromSource && $util.isInteger(message.objectsFoundFromSource.low) && $util.isInteger(message.objectsFoundFromSource.high))) + return "objectsFoundFromSource: integer|Long expected"; + if (message.bytesFoundFromSource != null && message.hasOwnProperty("bytesFoundFromSource")) + if (!$util.isInteger(message.bytesFoundFromSource) && !(message.bytesFoundFromSource && $util.isInteger(message.bytesFoundFromSource.low) && $util.isInteger(message.bytesFoundFromSource.high))) + return "bytesFoundFromSource: integer|Long expected"; + if (message.objectsFoundOnlyFromSink != null && message.hasOwnProperty("objectsFoundOnlyFromSink")) + if (!$util.isInteger(message.objectsFoundOnlyFromSink) && !(message.objectsFoundOnlyFromSink && $util.isInteger(message.objectsFoundOnlyFromSink.low) && $util.isInteger(message.objectsFoundOnlyFromSink.high))) + return "objectsFoundOnlyFromSink: integer|Long expected"; + if (message.bytesFoundOnlyFromSink != null && message.hasOwnProperty("bytesFoundOnlyFromSink")) + if (!$util.isInteger(message.bytesFoundOnlyFromSink) && !(message.bytesFoundOnlyFromSink && $util.isInteger(message.bytesFoundOnlyFromSink.low) && $util.isInteger(message.bytesFoundOnlyFromSink.high))) + return "bytesFoundOnlyFromSink: integer|Long expected"; + if (message.objectsFromSourceSkippedBySync != null && message.hasOwnProperty("objectsFromSourceSkippedBySync")) + if (!$util.isInteger(message.objectsFromSourceSkippedBySync) && !(message.objectsFromSourceSkippedBySync && $util.isInteger(message.objectsFromSourceSkippedBySync.low) && $util.isInteger(message.objectsFromSourceSkippedBySync.high))) + return "objectsFromSourceSkippedBySync: integer|Long expected"; + if (message.bytesFromSourceSkippedBySync != null && message.hasOwnProperty("bytesFromSourceSkippedBySync")) + if (!$util.isInteger(message.bytesFromSourceSkippedBySync) && !(message.bytesFromSourceSkippedBySync && $util.isInteger(message.bytesFromSourceSkippedBySync.low) && $util.isInteger(message.bytesFromSourceSkippedBySync.high))) + return "bytesFromSourceSkippedBySync: integer|Long expected"; + if (message.objectsCopiedToSink != null && message.hasOwnProperty("objectsCopiedToSink")) + if (!$util.isInteger(message.objectsCopiedToSink) && !(message.objectsCopiedToSink && $util.isInteger(message.objectsCopiedToSink.low) && $util.isInteger(message.objectsCopiedToSink.high))) + return "objectsCopiedToSink: integer|Long expected"; + if (message.bytesCopiedToSink != null && message.hasOwnProperty("bytesCopiedToSink")) + if (!$util.isInteger(message.bytesCopiedToSink) && !(message.bytesCopiedToSink && $util.isInteger(message.bytesCopiedToSink.low) && $util.isInteger(message.bytesCopiedToSink.high))) + return "bytesCopiedToSink: integer|Long expected"; + if (message.objectsDeletedFromSource != null && message.hasOwnProperty("objectsDeletedFromSource")) + if (!$util.isInteger(message.objectsDeletedFromSource) && !(message.objectsDeletedFromSource && $util.isInteger(message.objectsDeletedFromSource.low) && $util.isInteger(message.objectsDeletedFromSource.high))) + return "objectsDeletedFromSource: integer|Long expected"; + if (message.bytesDeletedFromSource != null && message.hasOwnProperty("bytesDeletedFromSource")) + if (!$util.isInteger(message.bytesDeletedFromSource) && !(message.bytesDeletedFromSource && $util.isInteger(message.bytesDeletedFromSource.low) && $util.isInteger(message.bytesDeletedFromSource.high))) + return "bytesDeletedFromSource: integer|Long expected"; + if (message.objectsDeletedFromSink != null && message.hasOwnProperty("objectsDeletedFromSink")) + if (!$util.isInteger(message.objectsDeletedFromSink) && !(message.objectsDeletedFromSink && $util.isInteger(message.objectsDeletedFromSink.low) && $util.isInteger(message.objectsDeletedFromSink.high))) + return "objectsDeletedFromSink: integer|Long expected"; + if (message.bytesDeletedFromSink != null && message.hasOwnProperty("bytesDeletedFromSink")) + if (!$util.isInteger(message.bytesDeletedFromSink) && !(message.bytesDeletedFromSink && $util.isInteger(message.bytesDeletedFromSink.low) && $util.isInteger(message.bytesDeletedFromSink.high))) + return "bytesDeletedFromSink: integer|Long expected"; + if (message.objectsFromSourceFailed != null && message.hasOwnProperty("objectsFromSourceFailed")) + if (!$util.isInteger(message.objectsFromSourceFailed) && !(message.objectsFromSourceFailed && $util.isInteger(message.objectsFromSourceFailed.low) && $util.isInteger(message.objectsFromSourceFailed.high))) + return "objectsFromSourceFailed: integer|Long expected"; + if (message.bytesFromSourceFailed != null && message.hasOwnProperty("bytesFromSourceFailed")) + if (!$util.isInteger(message.bytesFromSourceFailed) && !(message.bytesFromSourceFailed && $util.isInteger(message.bytesFromSourceFailed.low) && $util.isInteger(message.bytesFromSourceFailed.high))) + return "bytesFromSourceFailed: integer|Long expected"; + if (message.objectsFailedToDeleteFromSink != null && message.hasOwnProperty("objectsFailedToDeleteFromSink")) + if (!$util.isInteger(message.objectsFailedToDeleteFromSink) && !(message.objectsFailedToDeleteFromSink && $util.isInteger(message.objectsFailedToDeleteFromSink.low) && $util.isInteger(message.objectsFailedToDeleteFromSink.high))) + return "objectsFailedToDeleteFromSink: integer|Long expected"; + if (message.bytesFailedToDeleteFromSink != null && message.hasOwnProperty("bytesFailedToDeleteFromSink")) + if (!$util.isInteger(message.bytesFailedToDeleteFromSink) && !(message.bytesFailedToDeleteFromSink && $util.isInteger(message.bytesFailedToDeleteFromSink.low) && $util.isInteger(message.bytesFailedToDeleteFromSink.high))) + return "bytesFailedToDeleteFromSink: integer|Long expected"; + if (message.directoriesFoundFromSource != null && message.hasOwnProperty("directoriesFoundFromSource")) + if (!$util.isInteger(message.directoriesFoundFromSource) && !(message.directoriesFoundFromSource && $util.isInteger(message.directoriesFoundFromSource.low) && $util.isInteger(message.directoriesFoundFromSource.high))) + return "directoriesFoundFromSource: integer|Long expected"; + if (message.directoriesFailedToListFromSource != null && message.hasOwnProperty("directoriesFailedToListFromSource")) + if (!$util.isInteger(message.directoriesFailedToListFromSource) && !(message.directoriesFailedToListFromSource && $util.isInteger(message.directoriesFailedToListFromSource.low) && $util.isInteger(message.directoriesFailedToListFromSource.high))) + return "directoriesFailedToListFromSource: integer|Long expected"; + if (message.directoriesSuccessfullyListedFromSource != null && message.hasOwnProperty("directoriesSuccessfullyListedFromSource")) + if (!$util.isInteger(message.directoriesSuccessfullyListedFromSource) && !(message.directoriesSuccessfullyListedFromSource && $util.isInteger(message.directoriesSuccessfullyListedFromSource.low) && $util.isInteger(message.directoriesSuccessfullyListedFromSource.high))) + return "directoriesSuccessfullyListedFromSource: integer|Long expected"; + if (message.intermediateObjectsCleanedUp != null && message.hasOwnProperty("intermediateObjectsCleanedUp")) + if (!$util.isInteger(message.intermediateObjectsCleanedUp) && !(message.intermediateObjectsCleanedUp && $util.isInteger(message.intermediateObjectsCleanedUp.low) && $util.isInteger(message.intermediateObjectsCleanedUp.high))) + return "intermediateObjectsCleanedUp: integer|Long expected"; + if (message.intermediateObjectsFailedCleanedUp != null && message.hasOwnProperty("intermediateObjectsFailedCleanedUp")) + if (!$util.isInteger(message.intermediateObjectsFailedCleanedUp) && !(message.intermediateObjectsFailedCleanedUp && $util.isInteger(message.intermediateObjectsFailedCleanedUp.low) && $util.isInteger(message.intermediateObjectsFailedCleanedUp.high))) + return "intermediateObjectsFailedCleanedUp: integer|Long expected"; + return null; + }; + + /** + * Creates a TransferCounters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.TransferCounters} TransferCounters + */ + TransferCounters.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferCounters) + return object; + var message = new $root.google.storagetransfer.v1.TransferCounters(); + if (object.objectsFoundFromSource != null) + if ($util.Long) + (message.objectsFoundFromSource = $util.Long.fromValue(object.objectsFoundFromSource)).unsigned = false; + else if (typeof object.objectsFoundFromSource === "string") + message.objectsFoundFromSource = parseInt(object.objectsFoundFromSource, 10); + else if (typeof object.objectsFoundFromSource === "number") + message.objectsFoundFromSource = object.objectsFoundFromSource; + else if (typeof object.objectsFoundFromSource === "object") + message.objectsFoundFromSource = new $util.LongBits(object.objectsFoundFromSource.low >>> 0, object.objectsFoundFromSource.high >>> 0).toNumber(); + if (object.bytesFoundFromSource != null) + if ($util.Long) + (message.bytesFoundFromSource = $util.Long.fromValue(object.bytesFoundFromSource)).unsigned = false; + else if (typeof object.bytesFoundFromSource === "string") + message.bytesFoundFromSource = parseInt(object.bytesFoundFromSource, 10); + else if (typeof object.bytesFoundFromSource === "number") + message.bytesFoundFromSource = object.bytesFoundFromSource; + else if (typeof object.bytesFoundFromSource === "object") + message.bytesFoundFromSource = new $util.LongBits(object.bytesFoundFromSource.low >>> 0, object.bytesFoundFromSource.high >>> 0).toNumber(); + if (object.objectsFoundOnlyFromSink != null) + if ($util.Long) + (message.objectsFoundOnlyFromSink = $util.Long.fromValue(object.objectsFoundOnlyFromSink)).unsigned = false; + else if (typeof object.objectsFoundOnlyFromSink === "string") + message.objectsFoundOnlyFromSink = parseInt(object.objectsFoundOnlyFromSink, 10); + else if (typeof object.objectsFoundOnlyFromSink === "number") + message.objectsFoundOnlyFromSink = object.objectsFoundOnlyFromSink; + else if (typeof object.objectsFoundOnlyFromSink === "object") + message.objectsFoundOnlyFromSink = new $util.LongBits(object.objectsFoundOnlyFromSink.low >>> 0, object.objectsFoundOnlyFromSink.high >>> 0).toNumber(); + if (object.bytesFoundOnlyFromSink != null) + if ($util.Long) + (message.bytesFoundOnlyFromSink = $util.Long.fromValue(object.bytesFoundOnlyFromSink)).unsigned = false; + else if (typeof object.bytesFoundOnlyFromSink === "string") + message.bytesFoundOnlyFromSink = parseInt(object.bytesFoundOnlyFromSink, 10); + else if (typeof object.bytesFoundOnlyFromSink === "number") + message.bytesFoundOnlyFromSink = object.bytesFoundOnlyFromSink; + else if (typeof object.bytesFoundOnlyFromSink === "object") + message.bytesFoundOnlyFromSink = new $util.LongBits(object.bytesFoundOnlyFromSink.low >>> 0, object.bytesFoundOnlyFromSink.high >>> 0).toNumber(); + if (object.objectsFromSourceSkippedBySync != null) + if ($util.Long) + (message.objectsFromSourceSkippedBySync = $util.Long.fromValue(object.objectsFromSourceSkippedBySync)).unsigned = false; + else if (typeof object.objectsFromSourceSkippedBySync === "string") + message.objectsFromSourceSkippedBySync = parseInt(object.objectsFromSourceSkippedBySync, 10); + else if (typeof object.objectsFromSourceSkippedBySync === "number") + message.objectsFromSourceSkippedBySync = object.objectsFromSourceSkippedBySync; + else if (typeof object.objectsFromSourceSkippedBySync === "object") + message.objectsFromSourceSkippedBySync = new $util.LongBits(object.objectsFromSourceSkippedBySync.low >>> 0, object.objectsFromSourceSkippedBySync.high >>> 0).toNumber(); + if (object.bytesFromSourceSkippedBySync != null) + if ($util.Long) + (message.bytesFromSourceSkippedBySync = $util.Long.fromValue(object.bytesFromSourceSkippedBySync)).unsigned = false; + else if (typeof object.bytesFromSourceSkippedBySync === "string") + message.bytesFromSourceSkippedBySync = parseInt(object.bytesFromSourceSkippedBySync, 10); + else if (typeof object.bytesFromSourceSkippedBySync === "number") + message.bytesFromSourceSkippedBySync = object.bytesFromSourceSkippedBySync; + else if (typeof object.bytesFromSourceSkippedBySync === "object") + message.bytesFromSourceSkippedBySync = new $util.LongBits(object.bytesFromSourceSkippedBySync.low >>> 0, object.bytesFromSourceSkippedBySync.high >>> 0).toNumber(); + if (object.objectsCopiedToSink != null) + if ($util.Long) + (message.objectsCopiedToSink = $util.Long.fromValue(object.objectsCopiedToSink)).unsigned = false; + else if (typeof object.objectsCopiedToSink === "string") + message.objectsCopiedToSink = parseInt(object.objectsCopiedToSink, 10); + else if (typeof object.objectsCopiedToSink === "number") + message.objectsCopiedToSink = object.objectsCopiedToSink; + else if (typeof object.objectsCopiedToSink === "object") + message.objectsCopiedToSink = new $util.LongBits(object.objectsCopiedToSink.low >>> 0, object.objectsCopiedToSink.high >>> 0).toNumber(); + if (object.bytesCopiedToSink != null) + if ($util.Long) + (message.bytesCopiedToSink = $util.Long.fromValue(object.bytesCopiedToSink)).unsigned = false; + else if (typeof object.bytesCopiedToSink === "string") + message.bytesCopiedToSink = parseInt(object.bytesCopiedToSink, 10); + else if (typeof object.bytesCopiedToSink === "number") + message.bytesCopiedToSink = object.bytesCopiedToSink; + else if (typeof object.bytesCopiedToSink === "object") + message.bytesCopiedToSink = new $util.LongBits(object.bytesCopiedToSink.low >>> 0, object.bytesCopiedToSink.high >>> 0).toNumber(); + if (object.objectsDeletedFromSource != null) + if ($util.Long) + (message.objectsDeletedFromSource = $util.Long.fromValue(object.objectsDeletedFromSource)).unsigned = false; + else if (typeof object.objectsDeletedFromSource === "string") + message.objectsDeletedFromSource = parseInt(object.objectsDeletedFromSource, 10); + else if (typeof object.objectsDeletedFromSource === "number") + message.objectsDeletedFromSource = object.objectsDeletedFromSource; + else if (typeof object.objectsDeletedFromSource === "object") + message.objectsDeletedFromSource = new $util.LongBits(object.objectsDeletedFromSource.low >>> 0, object.objectsDeletedFromSource.high >>> 0).toNumber(); + if (object.bytesDeletedFromSource != null) + if ($util.Long) + (message.bytesDeletedFromSource = $util.Long.fromValue(object.bytesDeletedFromSource)).unsigned = false; + else if (typeof object.bytesDeletedFromSource === "string") + message.bytesDeletedFromSource = parseInt(object.bytesDeletedFromSource, 10); + else if (typeof object.bytesDeletedFromSource === "number") + message.bytesDeletedFromSource = object.bytesDeletedFromSource; + else if (typeof object.bytesDeletedFromSource === "object") + message.bytesDeletedFromSource = new $util.LongBits(object.bytesDeletedFromSource.low >>> 0, object.bytesDeletedFromSource.high >>> 0).toNumber(); + if (object.objectsDeletedFromSink != null) + if ($util.Long) + (message.objectsDeletedFromSink = $util.Long.fromValue(object.objectsDeletedFromSink)).unsigned = false; + else if (typeof object.objectsDeletedFromSink === "string") + message.objectsDeletedFromSink = parseInt(object.objectsDeletedFromSink, 10); + else if (typeof object.objectsDeletedFromSink === "number") + message.objectsDeletedFromSink = object.objectsDeletedFromSink; + else if (typeof object.objectsDeletedFromSink === "object") + message.objectsDeletedFromSink = new $util.LongBits(object.objectsDeletedFromSink.low >>> 0, object.objectsDeletedFromSink.high >>> 0).toNumber(); + if (object.bytesDeletedFromSink != null) + if ($util.Long) + (message.bytesDeletedFromSink = $util.Long.fromValue(object.bytesDeletedFromSink)).unsigned = false; + else if (typeof object.bytesDeletedFromSink === "string") + message.bytesDeletedFromSink = parseInt(object.bytesDeletedFromSink, 10); + else if (typeof object.bytesDeletedFromSink === "number") + message.bytesDeletedFromSink = object.bytesDeletedFromSink; + else if (typeof object.bytesDeletedFromSink === "object") + message.bytesDeletedFromSink = new $util.LongBits(object.bytesDeletedFromSink.low >>> 0, object.bytesDeletedFromSink.high >>> 0).toNumber(); + if (object.objectsFromSourceFailed != null) + if ($util.Long) + (message.objectsFromSourceFailed = $util.Long.fromValue(object.objectsFromSourceFailed)).unsigned = false; + else if (typeof object.objectsFromSourceFailed === "string") + message.objectsFromSourceFailed = parseInt(object.objectsFromSourceFailed, 10); + else if (typeof object.objectsFromSourceFailed === "number") + message.objectsFromSourceFailed = object.objectsFromSourceFailed; + else if (typeof object.objectsFromSourceFailed === "object") + message.objectsFromSourceFailed = new $util.LongBits(object.objectsFromSourceFailed.low >>> 0, object.objectsFromSourceFailed.high >>> 0).toNumber(); + if (object.bytesFromSourceFailed != null) + if ($util.Long) + (message.bytesFromSourceFailed = $util.Long.fromValue(object.bytesFromSourceFailed)).unsigned = false; + else if (typeof object.bytesFromSourceFailed === "string") + message.bytesFromSourceFailed = parseInt(object.bytesFromSourceFailed, 10); + else if (typeof object.bytesFromSourceFailed === "number") + message.bytesFromSourceFailed = object.bytesFromSourceFailed; + else if (typeof object.bytesFromSourceFailed === "object") + message.bytesFromSourceFailed = new $util.LongBits(object.bytesFromSourceFailed.low >>> 0, object.bytesFromSourceFailed.high >>> 0).toNumber(); + if (object.objectsFailedToDeleteFromSink != null) + if ($util.Long) + (message.objectsFailedToDeleteFromSink = $util.Long.fromValue(object.objectsFailedToDeleteFromSink)).unsigned = false; + else if (typeof object.objectsFailedToDeleteFromSink === "string") + message.objectsFailedToDeleteFromSink = parseInt(object.objectsFailedToDeleteFromSink, 10); + else if (typeof object.objectsFailedToDeleteFromSink === "number") + message.objectsFailedToDeleteFromSink = object.objectsFailedToDeleteFromSink; + else if (typeof object.objectsFailedToDeleteFromSink === "object") + message.objectsFailedToDeleteFromSink = new $util.LongBits(object.objectsFailedToDeleteFromSink.low >>> 0, object.objectsFailedToDeleteFromSink.high >>> 0).toNumber(); + if (object.bytesFailedToDeleteFromSink != null) + if ($util.Long) + (message.bytesFailedToDeleteFromSink = $util.Long.fromValue(object.bytesFailedToDeleteFromSink)).unsigned = false; + else if (typeof object.bytesFailedToDeleteFromSink === "string") + message.bytesFailedToDeleteFromSink = parseInt(object.bytesFailedToDeleteFromSink, 10); + else if (typeof object.bytesFailedToDeleteFromSink === "number") + message.bytesFailedToDeleteFromSink = object.bytesFailedToDeleteFromSink; + else if (typeof object.bytesFailedToDeleteFromSink === "object") + message.bytesFailedToDeleteFromSink = new $util.LongBits(object.bytesFailedToDeleteFromSink.low >>> 0, object.bytesFailedToDeleteFromSink.high >>> 0).toNumber(); + if (object.directoriesFoundFromSource != null) + if ($util.Long) + (message.directoriesFoundFromSource = $util.Long.fromValue(object.directoriesFoundFromSource)).unsigned = false; + else if (typeof object.directoriesFoundFromSource === "string") + message.directoriesFoundFromSource = parseInt(object.directoriesFoundFromSource, 10); + else if (typeof object.directoriesFoundFromSource === "number") + message.directoriesFoundFromSource = object.directoriesFoundFromSource; + else if (typeof object.directoriesFoundFromSource === "object") + message.directoriesFoundFromSource = new $util.LongBits(object.directoriesFoundFromSource.low >>> 0, object.directoriesFoundFromSource.high >>> 0).toNumber(); + if (object.directoriesFailedToListFromSource != null) + if ($util.Long) + (message.directoriesFailedToListFromSource = $util.Long.fromValue(object.directoriesFailedToListFromSource)).unsigned = false; + else if (typeof object.directoriesFailedToListFromSource === "string") + message.directoriesFailedToListFromSource = parseInt(object.directoriesFailedToListFromSource, 10); + else if (typeof object.directoriesFailedToListFromSource === "number") + message.directoriesFailedToListFromSource = object.directoriesFailedToListFromSource; + else if (typeof object.directoriesFailedToListFromSource === "object") + message.directoriesFailedToListFromSource = new $util.LongBits(object.directoriesFailedToListFromSource.low >>> 0, object.directoriesFailedToListFromSource.high >>> 0).toNumber(); + if (object.directoriesSuccessfullyListedFromSource != null) + if ($util.Long) + (message.directoriesSuccessfullyListedFromSource = $util.Long.fromValue(object.directoriesSuccessfullyListedFromSource)).unsigned = false; + else if (typeof object.directoriesSuccessfullyListedFromSource === "string") + message.directoriesSuccessfullyListedFromSource = parseInt(object.directoriesSuccessfullyListedFromSource, 10); + else if (typeof object.directoriesSuccessfullyListedFromSource === "number") + message.directoriesSuccessfullyListedFromSource = object.directoriesSuccessfullyListedFromSource; + else if (typeof object.directoriesSuccessfullyListedFromSource === "object") + message.directoriesSuccessfullyListedFromSource = new $util.LongBits(object.directoriesSuccessfullyListedFromSource.low >>> 0, object.directoriesSuccessfullyListedFromSource.high >>> 0).toNumber(); + if (object.intermediateObjectsCleanedUp != null) + if ($util.Long) + (message.intermediateObjectsCleanedUp = $util.Long.fromValue(object.intermediateObjectsCleanedUp)).unsigned = false; + else if (typeof object.intermediateObjectsCleanedUp === "string") + message.intermediateObjectsCleanedUp = parseInt(object.intermediateObjectsCleanedUp, 10); + else if (typeof object.intermediateObjectsCleanedUp === "number") + message.intermediateObjectsCleanedUp = object.intermediateObjectsCleanedUp; + else if (typeof object.intermediateObjectsCleanedUp === "object") + message.intermediateObjectsCleanedUp = new $util.LongBits(object.intermediateObjectsCleanedUp.low >>> 0, object.intermediateObjectsCleanedUp.high >>> 0).toNumber(); + if (object.intermediateObjectsFailedCleanedUp != null) + if ($util.Long) + (message.intermediateObjectsFailedCleanedUp = $util.Long.fromValue(object.intermediateObjectsFailedCleanedUp)).unsigned = false; + else if (typeof object.intermediateObjectsFailedCleanedUp === "string") + message.intermediateObjectsFailedCleanedUp = parseInt(object.intermediateObjectsFailedCleanedUp, 10); + else if (typeof object.intermediateObjectsFailedCleanedUp === "number") + message.intermediateObjectsFailedCleanedUp = object.intermediateObjectsFailedCleanedUp; + else if (typeof object.intermediateObjectsFailedCleanedUp === "object") + message.intermediateObjectsFailedCleanedUp = new $util.LongBits(object.intermediateObjectsFailedCleanedUp.low >>> 0, object.intermediateObjectsFailedCleanedUp.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TransferCounters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {google.storagetransfer.v1.TransferCounters} message TransferCounters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferCounters.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.objectsFoundFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsFoundFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesFoundFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesFoundFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsFoundOnlyFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsFoundOnlyFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesFoundOnlyFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesFoundOnlyFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsFromSourceSkippedBySync = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsFromSourceSkippedBySync = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesFromSourceSkippedBySync = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesFromSourceSkippedBySync = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsCopiedToSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsCopiedToSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesCopiedToSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesCopiedToSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsDeletedFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsDeletedFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesDeletedFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesDeletedFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsDeletedFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsDeletedFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesDeletedFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesDeletedFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsFromSourceFailed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsFromSourceFailed = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesFromSourceFailed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesFromSourceFailed = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsFailedToDeleteFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsFailedToDeleteFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesFailedToDeleteFromSink = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesFailedToDeleteFromSink = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.directoriesFoundFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.directoriesFoundFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.directoriesFailedToListFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.directoriesFailedToListFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.directoriesSuccessfullyListedFromSource = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.directoriesSuccessfullyListedFromSource = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.intermediateObjectsCleanedUp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.intermediateObjectsCleanedUp = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.intermediateObjectsFailedCleanedUp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.intermediateObjectsFailedCleanedUp = options.longs === String ? "0" : 0; + } + if (message.objectsFoundFromSource != null && message.hasOwnProperty("objectsFoundFromSource")) + if (typeof message.objectsFoundFromSource === "number") + object.objectsFoundFromSource = options.longs === String ? String(message.objectsFoundFromSource) : message.objectsFoundFromSource; + else + object.objectsFoundFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFoundFromSource) : options.longs === Number ? new $util.LongBits(message.objectsFoundFromSource.low >>> 0, message.objectsFoundFromSource.high >>> 0).toNumber() : message.objectsFoundFromSource; + if (message.bytesFoundFromSource != null && message.hasOwnProperty("bytesFoundFromSource")) + if (typeof message.bytesFoundFromSource === "number") + object.bytesFoundFromSource = options.longs === String ? String(message.bytesFoundFromSource) : message.bytesFoundFromSource; + else + object.bytesFoundFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFoundFromSource) : options.longs === Number ? new $util.LongBits(message.bytesFoundFromSource.low >>> 0, message.bytesFoundFromSource.high >>> 0).toNumber() : message.bytesFoundFromSource; + if (message.objectsFoundOnlyFromSink != null && message.hasOwnProperty("objectsFoundOnlyFromSink")) + if (typeof message.objectsFoundOnlyFromSink === "number") + object.objectsFoundOnlyFromSink = options.longs === String ? String(message.objectsFoundOnlyFromSink) : message.objectsFoundOnlyFromSink; + else + object.objectsFoundOnlyFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFoundOnlyFromSink) : options.longs === Number ? new $util.LongBits(message.objectsFoundOnlyFromSink.low >>> 0, message.objectsFoundOnlyFromSink.high >>> 0).toNumber() : message.objectsFoundOnlyFromSink; + if (message.bytesFoundOnlyFromSink != null && message.hasOwnProperty("bytesFoundOnlyFromSink")) + if (typeof message.bytesFoundOnlyFromSink === "number") + object.bytesFoundOnlyFromSink = options.longs === String ? String(message.bytesFoundOnlyFromSink) : message.bytesFoundOnlyFromSink; + else + object.bytesFoundOnlyFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFoundOnlyFromSink) : options.longs === Number ? new $util.LongBits(message.bytesFoundOnlyFromSink.low >>> 0, message.bytesFoundOnlyFromSink.high >>> 0).toNumber() : message.bytesFoundOnlyFromSink; + if (message.objectsFromSourceSkippedBySync != null && message.hasOwnProperty("objectsFromSourceSkippedBySync")) + if (typeof message.objectsFromSourceSkippedBySync === "number") + object.objectsFromSourceSkippedBySync = options.longs === String ? String(message.objectsFromSourceSkippedBySync) : message.objectsFromSourceSkippedBySync; + else + object.objectsFromSourceSkippedBySync = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFromSourceSkippedBySync) : options.longs === Number ? new $util.LongBits(message.objectsFromSourceSkippedBySync.low >>> 0, message.objectsFromSourceSkippedBySync.high >>> 0).toNumber() : message.objectsFromSourceSkippedBySync; + if (message.bytesFromSourceSkippedBySync != null && message.hasOwnProperty("bytesFromSourceSkippedBySync")) + if (typeof message.bytesFromSourceSkippedBySync === "number") + object.bytesFromSourceSkippedBySync = options.longs === String ? String(message.bytesFromSourceSkippedBySync) : message.bytesFromSourceSkippedBySync; + else + object.bytesFromSourceSkippedBySync = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFromSourceSkippedBySync) : options.longs === Number ? new $util.LongBits(message.bytesFromSourceSkippedBySync.low >>> 0, message.bytesFromSourceSkippedBySync.high >>> 0).toNumber() : message.bytesFromSourceSkippedBySync; + if (message.objectsCopiedToSink != null && message.hasOwnProperty("objectsCopiedToSink")) + if (typeof message.objectsCopiedToSink === "number") + object.objectsCopiedToSink = options.longs === String ? String(message.objectsCopiedToSink) : message.objectsCopiedToSink; + else + object.objectsCopiedToSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsCopiedToSink) : options.longs === Number ? new $util.LongBits(message.objectsCopiedToSink.low >>> 0, message.objectsCopiedToSink.high >>> 0).toNumber() : message.objectsCopiedToSink; + if (message.bytesCopiedToSink != null && message.hasOwnProperty("bytesCopiedToSink")) + if (typeof message.bytesCopiedToSink === "number") + object.bytesCopiedToSink = options.longs === String ? String(message.bytesCopiedToSink) : message.bytesCopiedToSink; + else + object.bytesCopiedToSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesCopiedToSink) : options.longs === Number ? new $util.LongBits(message.bytesCopiedToSink.low >>> 0, message.bytesCopiedToSink.high >>> 0).toNumber() : message.bytesCopiedToSink; + if (message.objectsDeletedFromSource != null && message.hasOwnProperty("objectsDeletedFromSource")) + if (typeof message.objectsDeletedFromSource === "number") + object.objectsDeletedFromSource = options.longs === String ? String(message.objectsDeletedFromSource) : message.objectsDeletedFromSource; + else + object.objectsDeletedFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.objectsDeletedFromSource) : options.longs === Number ? new $util.LongBits(message.objectsDeletedFromSource.low >>> 0, message.objectsDeletedFromSource.high >>> 0).toNumber() : message.objectsDeletedFromSource; + if (message.bytesDeletedFromSource != null && message.hasOwnProperty("bytesDeletedFromSource")) + if (typeof message.bytesDeletedFromSource === "number") + object.bytesDeletedFromSource = options.longs === String ? String(message.bytesDeletedFromSource) : message.bytesDeletedFromSource; + else + object.bytesDeletedFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDeletedFromSource) : options.longs === Number ? new $util.LongBits(message.bytesDeletedFromSource.low >>> 0, message.bytesDeletedFromSource.high >>> 0).toNumber() : message.bytesDeletedFromSource; + if (message.objectsDeletedFromSink != null && message.hasOwnProperty("objectsDeletedFromSink")) + if (typeof message.objectsDeletedFromSink === "number") + object.objectsDeletedFromSink = options.longs === String ? String(message.objectsDeletedFromSink) : message.objectsDeletedFromSink; + else + object.objectsDeletedFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsDeletedFromSink) : options.longs === Number ? new $util.LongBits(message.objectsDeletedFromSink.low >>> 0, message.objectsDeletedFromSink.high >>> 0).toNumber() : message.objectsDeletedFromSink; + if (message.bytesDeletedFromSink != null && message.hasOwnProperty("bytesDeletedFromSink")) + if (typeof message.bytesDeletedFromSink === "number") + object.bytesDeletedFromSink = options.longs === String ? String(message.bytesDeletedFromSink) : message.bytesDeletedFromSink; + else + object.bytesDeletedFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesDeletedFromSink) : options.longs === Number ? new $util.LongBits(message.bytesDeletedFromSink.low >>> 0, message.bytesDeletedFromSink.high >>> 0).toNumber() : message.bytesDeletedFromSink; + if (message.objectsFromSourceFailed != null && message.hasOwnProperty("objectsFromSourceFailed")) + if (typeof message.objectsFromSourceFailed === "number") + object.objectsFromSourceFailed = options.longs === String ? String(message.objectsFromSourceFailed) : message.objectsFromSourceFailed; + else + object.objectsFromSourceFailed = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFromSourceFailed) : options.longs === Number ? new $util.LongBits(message.objectsFromSourceFailed.low >>> 0, message.objectsFromSourceFailed.high >>> 0).toNumber() : message.objectsFromSourceFailed; + if (message.bytesFromSourceFailed != null && message.hasOwnProperty("bytesFromSourceFailed")) + if (typeof message.bytesFromSourceFailed === "number") + object.bytesFromSourceFailed = options.longs === String ? String(message.bytesFromSourceFailed) : message.bytesFromSourceFailed; + else + object.bytesFromSourceFailed = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFromSourceFailed) : options.longs === Number ? new $util.LongBits(message.bytesFromSourceFailed.low >>> 0, message.bytesFromSourceFailed.high >>> 0).toNumber() : message.bytesFromSourceFailed; + if (message.objectsFailedToDeleteFromSink != null && message.hasOwnProperty("objectsFailedToDeleteFromSink")) + if (typeof message.objectsFailedToDeleteFromSink === "number") + object.objectsFailedToDeleteFromSink = options.longs === String ? String(message.objectsFailedToDeleteFromSink) : message.objectsFailedToDeleteFromSink; + else + object.objectsFailedToDeleteFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFailedToDeleteFromSink) : options.longs === Number ? new $util.LongBits(message.objectsFailedToDeleteFromSink.low >>> 0, message.objectsFailedToDeleteFromSink.high >>> 0).toNumber() : message.objectsFailedToDeleteFromSink; + if (message.bytesFailedToDeleteFromSink != null && message.hasOwnProperty("bytesFailedToDeleteFromSink")) + if (typeof message.bytesFailedToDeleteFromSink === "number") + object.bytesFailedToDeleteFromSink = options.longs === String ? String(message.bytesFailedToDeleteFromSink) : message.bytesFailedToDeleteFromSink; + else + object.bytesFailedToDeleteFromSink = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFailedToDeleteFromSink) : options.longs === Number ? new $util.LongBits(message.bytesFailedToDeleteFromSink.low >>> 0, message.bytesFailedToDeleteFromSink.high >>> 0).toNumber() : message.bytesFailedToDeleteFromSink; + if (message.directoriesFoundFromSource != null && message.hasOwnProperty("directoriesFoundFromSource")) + if (typeof message.directoriesFoundFromSource === "number") + object.directoriesFoundFromSource = options.longs === String ? String(message.directoriesFoundFromSource) : message.directoriesFoundFromSource; + else + object.directoriesFoundFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.directoriesFoundFromSource) : options.longs === Number ? new $util.LongBits(message.directoriesFoundFromSource.low >>> 0, message.directoriesFoundFromSource.high >>> 0).toNumber() : message.directoriesFoundFromSource; + if (message.directoriesFailedToListFromSource != null && message.hasOwnProperty("directoriesFailedToListFromSource")) + if (typeof message.directoriesFailedToListFromSource === "number") + object.directoriesFailedToListFromSource = options.longs === String ? String(message.directoriesFailedToListFromSource) : message.directoriesFailedToListFromSource; + else + object.directoriesFailedToListFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.directoriesFailedToListFromSource) : options.longs === Number ? new $util.LongBits(message.directoriesFailedToListFromSource.low >>> 0, message.directoriesFailedToListFromSource.high >>> 0).toNumber() : message.directoriesFailedToListFromSource; + if (message.directoriesSuccessfullyListedFromSource != null && message.hasOwnProperty("directoriesSuccessfullyListedFromSource")) + if (typeof message.directoriesSuccessfullyListedFromSource === "number") + object.directoriesSuccessfullyListedFromSource = options.longs === String ? String(message.directoriesSuccessfullyListedFromSource) : message.directoriesSuccessfullyListedFromSource; + else + object.directoriesSuccessfullyListedFromSource = options.longs === String ? $util.Long.prototype.toString.call(message.directoriesSuccessfullyListedFromSource) : options.longs === Number ? new $util.LongBits(message.directoriesSuccessfullyListedFromSource.low >>> 0, message.directoriesSuccessfullyListedFromSource.high >>> 0).toNumber() : message.directoriesSuccessfullyListedFromSource; + if (message.intermediateObjectsCleanedUp != null && message.hasOwnProperty("intermediateObjectsCleanedUp")) + if (typeof message.intermediateObjectsCleanedUp === "number") + object.intermediateObjectsCleanedUp = options.longs === String ? String(message.intermediateObjectsCleanedUp) : message.intermediateObjectsCleanedUp; + else + object.intermediateObjectsCleanedUp = options.longs === String ? $util.Long.prototype.toString.call(message.intermediateObjectsCleanedUp) : options.longs === Number ? new $util.LongBits(message.intermediateObjectsCleanedUp.low >>> 0, message.intermediateObjectsCleanedUp.high >>> 0).toNumber() : message.intermediateObjectsCleanedUp; + if (message.intermediateObjectsFailedCleanedUp != null && message.hasOwnProperty("intermediateObjectsFailedCleanedUp")) + if (typeof message.intermediateObjectsFailedCleanedUp === "number") + object.intermediateObjectsFailedCleanedUp = options.longs === String ? String(message.intermediateObjectsFailedCleanedUp) : message.intermediateObjectsFailedCleanedUp; + else + object.intermediateObjectsFailedCleanedUp = options.longs === String ? $util.Long.prototype.toString.call(message.intermediateObjectsFailedCleanedUp) : options.longs === Number ? new $util.LongBits(message.intermediateObjectsFailedCleanedUp.low >>> 0, message.intermediateObjectsFailedCleanedUp.high >>> 0).toNumber() : message.intermediateObjectsFailedCleanedUp; + return object; + }; + + /** + * Converts this TransferCounters to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.TransferCounters + * @instance + * @returns {Object.} JSON object + */ + TransferCounters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferCounters + * @function getTypeUrl + * @memberof google.storagetransfer.v1.TransferCounters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferCounters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.TransferCounters"; + }; + + return TransferCounters; + })(); + + v1.NotificationConfig = (function() { + + /** + * Properties of a NotificationConfig. + * @memberof google.storagetransfer.v1 + * @interface INotificationConfig + * @property {string|null} [pubsubTopic] NotificationConfig pubsubTopic + * @property {Array.|null} [eventTypes] NotificationConfig eventTypes + * @property {google.storagetransfer.v1.NotificationConfig.PayloadFormat|null} [payloadFormat] NotificationConfig payloadFormat + */ + + /** + * Constructs a new NotificationConfig. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig + * @constructor + * @param {google.storagetransfer.v1.INotificationConfig=} [properties] Properties to set + */ + function NotificationConfig(properties) { + this.eventTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationConfig pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.storagetransfer.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.pubsubTopic = ""; + + /** + * NotificationConfig eventTypes. + * @member {Array.} eventTypes + * @memberof google.storagetransfer.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.eventTypes = $util.emptyArray; + + /** + * NotificationConfig payloadFormat. + * @member {google.storagetransfer.v1.NotificationConfig.PayloadFormat} payloadFormat + * @memberof google.storagetransfer.v1.NotificationConfig + * @instance + */ + NotificationConfig.prototype.payloadFormat = 0; + + /** + * Creates a new NotificationConfig instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {google.storagetransfer.v1.INotificationConfig=} [properties] Properties to set + * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig instance + */ + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); + }; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.storagetransfer.v1.NotificationConfig.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {google.storagetransfer.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); + if (message.eventTypes != null && message.eventTypes.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.eventTypes.length; ++i) + writer.int32(message.eventTypes[i]); + writer.ldelim(); + } + if (message.payloadFormat != null && Object.hasOwnProperty.call(message, "payloadFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.payloadFormat); + return writer; + }; + + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.storagetransfer.v1.NotificationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {google.storagetransfer.v1.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.NotificationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pubsubTopic = reader.string(); + break; + } + case 2: { + if (!(message.eventTypes && message.eventTypes.length)) + message.eventTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.eventTypes.push(reader.int32()); + } else + message.eventTypes.push(reader.int32()); + break; + } + case 3: { + message.payloadFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationConfig message. + * @function verify + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.eventTypes != null && message.hasOwnProperty("eventTypes")) { + if (!Array.isArray(message.eventTypes)) + return "eventTypes: array expected"; + for (var i = 0; i < message.eventTypes.length; ++i) + switch (message.eventTypes[i]) { + default: + return "eventTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.payloadFormat != null && message.hasOwnProperty("payloadFormat")) + switch (message.payloadFormat) { + default: + return "payloadFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.NotificationConfig} NotificationConfig + */ + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.NotificationConfig) + return object; + var message = new $root.google.storagetransfer.v1.NotificationConfig(); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.eventTypes) { + if (!Array.isArray(object.eventTypes)) + throw TypeError(".google.storagetransfer.v1.NotificationConfig.eventTypes: array expected"); + message.eventTypes = []; + for (var i = 0; i < object.eventTypes.length; ++i) + switch (object.eventTypes[i]) { + default: + if (typeof object.eventTypes[i] === "number") { + message.eventTypes[i] = object.eventTypes[i]; + break; + } + case "EVENT_TYPE_UNSPECIFIED": + case 0: + message.eventTypes[i] = 0; + break; + case "TRANSFER_OPERATION_SUCCESS": + case 1: + message.eventTypes[i] = 1; + break; + case "TRANSFER_OPERATION_FAILED": + case 2: + message.eventTypes[i] = 2; + break; + case "TRANSFER_OPERATION_ABORTED": + case 3: + message.eventTypes[i] = 3; + break; + } + } + switch (object.payloadFormat) { + default: + if (typeof object.payloadFormat === "number") { + message.payloadFormat = object.payloadFormat; + break; + } + break; + case "PAYLOAD_FORMAT_UNSPECIFIED": + case 0: + message.payloadFormat = 0; + break; + case "NONE": + case 1: + message.payloadFormat = 1; + break; + case "JSON": + case 2: + message.payloadFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {google.storagetransfer.v1.NotificationConfig} message NotificationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.eventTypes = []; + if (options.defaults) { + object.pubsubTopic = ""; + object.payloadFormat = options.enums === String ? "PAYLOAD_FORMAT_UNSPECIFIED" : 0; + } + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.eventTypes && message.eventTypes.length) { + object.eventTypes = []; + for (var j = 0; j < message.eventTypes.length; ++j) + object.eventTypes[j] = options.enums === String ? $root.google.storagetransfer.v1.NotificationConfig.EventType[message.eventTypes[j]] === undefined ? message.eventTypes[j] : $root.google.storagetransfer.v1.NotificationConfig.EventType[message.eventTypes[j]] : message.eventTypes[j]; + } + if (message.payloadFormat != null && message.hasOwnProperty("payloadFormat")) + object.payloadFormat = options.enums === String ? $root.google.storagetransfer.v1.NotificationConfig.PayloadFormat[message.payloadFormat] === undefined ? message.payloadFormat : $root.google.storagetransfer.v1.NotificationConfig.PayloadFormat[message.payloadFormat] : message.payloadFormat; + return object; + }; + + /** + * Converts this NotificationConfig to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.NotificationConfig + * @instance + * @returns {Object.} JSON object + */ + NotificationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotificationConfig + * @function getTypeUrl + * @memberof google.storagetransfer.v1.NotificationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotificationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.NotificationConfig"; + }; + + /** + * EventType enum. + * @name google.storagetransfer.v1.NotificationConfig.EventType + * @enum {number} + * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value + * @property {number} TRANSFER_OPERATION_SUCCESS=1 TRANSFER_OPERATION_SUCCESS value + * @property {number} TRANSFER_OPERATION_FAILED=2 TRANSFER_OPERATION_FAILED value + * @property {number} TRANSFER_OPERATION_ABORTED=3 TRANSFER_OPERATION_ABORTED value + */ + NotificationConfig.EventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRANSFER_OPERATION_SUCCESS"] = 1; + values[valuesById[2] = "TRANSFER_OPERATION_FAILED"] = 2; + values[valuesById[3] = "TRANSFER_OPERATION_ABORTED"] = 3; + return values; + })(); + + /** + * PayloadFormat enum. + * @name google.storagetransfer.v1.NotificationConfig.PayloadFormat + * @enum {number} + * @property {number} PAYLOAD_FORMAT_UNSPECIFIED=0 PAYLOAD_FORMAT_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} JSON=2 JSON value + */ + NotificationConfig.PayloadFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PAYLOAD_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "JSON"] = 2; + return values; + })(); + + return NotificationConfig; + })(); + + v1.LoggingConfig = (function() { + + /** + * Properties of a LoggingConfig. + * @memberof google.storagetransfer.v1 + * @interface ILoggingConfig + * @property {Array.|null} [logActions] LoggingConfig logActions + * @property {Array.|null} [logActionStates] LoggingConfig logActionStates + * @property {boolean|null} [enableOnpremGcsTransferLogs] LoggingConfig enableOnpremGcsTransferLogs + */ + + /** + * Constructs a new LoggingConfig. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a LoggingConfig. + * @implements ILoggingConfig + * @constructor + * @param {google.storagetransfer.v1.ILoggingConfig=} [properties] Properties to set + */ + function LoggingConfig(properties) { + this.logActions = []; + this.logActionStates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoggingConfig logActions. + * @member {Array.} logActions + * @memberof google.storagetransfer.v1.LoggingConfig + * @instance + */ + LoggingConfig.prototype.logActions = $util.emptyArray; + + /** + * LoggingConfig logActionStates. + * @member {Array.} logActionStates + * @memberof google.storagetransfer.v1.LoggingConfig + * @instance + */ + LoggingConfig.prototype.logActionStates = $util.emptyArray; + + /** + * LoggingConfig enableOnpremGcsTransferLogs. + * @member {boolean} enableOnpremGcsTransferLogs + * @memberof google.storagetransfer.v1.LoggingConfig + * @instance + */ + LoggingConfig.prototype.enableOnpremGcsTransferLogs = false; + + /** + * Creates a new LoggingConfig instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {google.storagetransfer.v1.ILoggingConfig=} [properties] Properties to set + * @returns {google.storagetransfer.v1.LoggingConfig} LoggingConfig instance + */ + LoggingConfig.create = function create(properties) { + return new LoggingConfig(properties); + }; + + /** + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.storagetransfer.v1.LoggingConfig.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {google.storagetransfer.v1.ILoggingConfig} message LoggingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logActions != null && message.logActions.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.logActions.length; ++i) + writer.int32(message.logActions[i]); + writer.ldelim(); + } + if (message.logActionStates != null && message.logActionStates.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.logActionStates.length; ++i) + writer.int32(message.logActionStates[i]); + writer.ldelim(); + } + if (message.enableOnpremGcsTransferLogs != null && Object.hasOwnProperty.call(message, "enableOnpremGcsTransferLogs")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableOnpremGcsTransferLogs); + return writer; + }; + + /** + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.storagetransfer.v1.LoggingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {google.storagetransfer.v1.ILoggingConfig} message LoggingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.LoggingConfig} LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.LoggingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.logActions && message.logActions.length)) + message.logActions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.logActions.push(reader.int32()); + } else + message.logActions.push(reader.int32()); + break; + } + case 2: { + if (!(message.logActionStates && message.logActionStates.length)) + message.logActionStates = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.logActionStates.push(reader.int32()); + } else + message.logActionStates.push(reader.int32()); + break; + } + case 3: { + message.enableOnpremGcsTransferLogs = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.LoggingConfig} LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoggingConfig message. + * @function verify + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoggingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logActions != null && message.hasOwnProperty("logActions")) { + if (!Array.isArray(message.logActions)) + return "logActions: array expected"; + for (var i = 0; i < message.logActions.length; ++i) + switch (message.logActions[i]) { + default: + return "logActions: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.logActionStates != null && message.hasOwnProperty("logActionStates")) { + if (!Array.isArray(message.logActionStates)) + return "logActionStates: array expected"; + for (var i = 0; i < message.logActionStates.length; ++i) + switch (message.logActionStates[i]) { + default: + return "logActionStates: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.enableOnpremGcsTransferLogs != null && message.hasOwnProperty("enableOnpremGcsTransferLogs")) + if (typeof message.enableOnpremGcsTransferLogs !== "boolean") + return "enableOnpremGcsTransferLogs: boolean expected"; + return null; + }; + + /** + * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.LoggingConfig} LoggingConfig + */ + LoggingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.LoggingConfig) + return object; + var message = new $root.google.storagetransfer.v1.LoggingConfig(); + if (object.logActions) { + if (!Array.isArray(object.logActions)) + throw TypeError(".google.storagetransfer.v1.LoggingConfig.logActions: array expected"); + message.logActions = []; + for (var i = 0; i < object.logActions.length; ++i) + switch (object.logActions[i]) { + default: + if (typeof object.logActions[i] === "number") { + message.logActions[i] = object.logActions[i]; + break; + } + case "LOGGABLE_ACTION_UNSPECIFIED": + case 0: + message.logActions[i] = 0; + break; + case "FIND": + case 1: + message.logActions[i] = 1; + break; + case "DELETE": + case 2: + message.logActions[i] = 2; + break; + case "COPY": + case 3: + message.logActions[i] = 3; + break; + } + } + if (object.logActionStates) { + if (!Array.isArray(object.logActionStates)) + throw TypeError(".google.storagetransfer.v1.LoggingConfig.logActionStates: array expected"); + message.logActionStates = []; + for (var i = 0; i < object.logActionStates.length; ++i) + switch (object.logActionStates[i]) { + default: + if (typeof object.logActionStates[i] === "number") { + message.logActionStates[i] = object.logActionStates[i]; + break; + } + case "LOGGABLE_ACTION_STATE_UNSPECIFIED": + case 0: + message.logActionStates[i] = 0; + break; + case "SUCCEEDED": + case 1: + message.logActionStates[i] = 1; + break; + case "FAILED": + case 2: + message.logActionStates[i] = 2; + break; + } + } + if (object.enableOnpremGcsTransferLogs != null) + message.enableOnpremGcsTransferLogs = Boolean(object.enableOnpremGcsTransferLogs); + return message; + }; + + /** + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {google.storagetransfer.v1.LoggingConfig} message LoggingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoggingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.logActions = []; + object.logActionStates = []; + } + if (options.defaults) + object.enableOnpremGcsTransferLogs = false; + if (message.logActions && message.logActions.length) { + object.logActions = []; + for (var j = 0; j < message.logActions.length; ++j) + object.logActions[j] = options.enums === String ? $root.google.storagetransfer.v1.LoggingConfig.LoggableAction[message.logActions[j]] === undefined ? message.logActions[j] : $root.google.storagetransfer.v1.LoggingConfig.LoggableAction[message.logActions[j]] : message.logActions[j]; + } + if (message.logActionStates && message.logActionStates.length) { + object.logActionStates = []; + for (var j = 0; j < message.logActionStates.length; ++j) + object.logActionStates[j] = options.enums === String ? $root.google.storagetransfer.v1.LoggingConfig.LoggableActionState[message.logActionStates[j]] === undefined ? message.logActionStates[j] : $root.google.storagetransfer.v1.LoggingConfig.LoggableActionState[message.logActionStates[j]] : message.logActionStates[j]; + } + if (message.enableOnpremGcsTransferLogs != null && message.hasOwnProperty("enableOnpremGcsTransferLogs")) + object.enableOnpremGcsTransferLogs = message.enableOnpremGcsTransferLogs; + return object; + }; + + /** + * Converts this LoggingConfig to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.LoggingConfig + * @instance + * @returns {Object.} JSON object + */ + LoggingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoggingConfig + * @function getTypeUrl + * @memberof google.storagetransfer.v1.LoggingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoggingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.LoggingConfig"; + }; + + /** + * LoggableAction enum. + * @name google.storagetransfer.v1.LoggingConfig.LoggableAction + * @enum {number} + * @property {number} LOGGABLE_ACTION_UNSPECIFIED=0 LOGGABLE_ACTION_UNSPECIFIED value + * @property {number} FIND=1 FIND value + * @property {number} DELETE=2 DELETE value + * @property {number} COPY=3 COPY value + */ + LoggingConfig.LoggableAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOGGABLE_ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIND"] = 1; + values[valuesById[2] = "DELETE"] = 2; + values[valuesById[3] = "COPY"] = 3; + return values; + })(); + + /** + * LoggableActionState enum. + * @name google.storagetransfer.v1.LoggingConfig.LoggableActionState + * @enum {number} + * @property {number} LOGGABLE_ACTION_STATE_UNSPECIFIED=0 LOGGABLE_ACTION_STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + */ + LoggingConfig.LoggableActionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOGGABLE_ACTION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + return values; + })(); + + return LoggingConfig; + })(); + + v1.TransferOperation = (function() { + + /** + * Properties of a TransferOperation. + * @memberof google.storagetransfer.v1 + * @interface ITransferOperation + * @property {string|null} [name] TransferOperation name + * @property {string|null} [projectId] TransferOperation projectId + * @property {google.storagetransfer.v1.ITransferSpec|null} [transferSpec] TransferOperation transferSpec + * @property {google.storagetransfer.v1.INotificationConfig|null} [notificationConfig] TransferOperation notificationConfig + * @property {google.protobuf.ITimestamp|null} [startTime] TransferOperation startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TransferOperation endTime + * @property {google.storagetransfer.v1.TransferOperation.Status|null} [status] TransferOperation status + * @property {google.storagetransfer.v1.ITransferCounters|null} [counters] TransferOperation counters + * @property {Array.|null} [errorBreakdowns] TransferOperation errorBreakdowns + * @property {string|null} [transferJobName] TransferOperation transferJobName + */ + + /** + * Constructs a new TransferOperation. + * @memberof google.storagetransfer.v1 + * @classdesc Represents a TransferOperation. + * @implements ITransferOperation + * @constructor + * @param {google.storagetransfer.v1.ITransferOperation=} [properties] Properties to set + */ + function TransferOperation(properties) { + this.errorBreakdowns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferOperation name. + * @member {string} name + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.name = ""; + + /** + * TransferOperation projectId. + * @member {string} projectId + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.projectId = ""; + + /** + * TransferOperation transferSpec. + * @member {google.storagetransfer.v1.ITransferSpec|null|undefined} transferSpec + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.transferSpec = null; + + /** + * TransferOperation notificationConfig. + * @member {google.storagetransfer.v1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.notificationConfig = null; + + /** + * TransferOperation startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.startTime = null; + + /** + * TransferOperation endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.endTime = null; + + /** + * TransferOperation status. + * @member {google.storagetransfer.v1.TransferOperation.Status} status + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.status = 0; + + /** + * TransferOperation counters. + * @member {google.storagetransfer.v1.ITransferCounters|null|undefined} counters + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.counters = null; + + /** + * TransferOperation errorBreakdowns. + * @member {Array.} errorBreakdowns + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.errorBreakdowns = $util.emptyArray; + + /** + * TransferOperation transferJobName. + * @member {string} transferJobName + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + */ + TransferOperation.prototype.transferJobName = ""; + + /** + * Creates a new TransferOperation instance using the specified properties. + * @function create + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {google.storagetransfer.v1.ITransferOperation=} [properties] Properties to set + * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation instance + */ + TransferOperation.create = function create(properties) { + return new TransferOperation(properties); + }; + + /** + * Encodes the specified TransferOperation message. Does not implicitly {@link google.storagetransfer.v1.TransferOperation.verify|verify} messages. + * @function encode + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {google.storagetransfer.v1.ITransferOperation} message TransferOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOperation.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.transferSpec != null && Object.hasOwnProperty.call(message, "transferSpec")) + $root.google.storagetransfer.v1.TransferSpec.encode(message.transferSpec, 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.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.status); + if (message.counters != null && Object.hasOwnProperty.call(message, "counters")) + $root.google.storagetransfer.v1.TransferCounters.encode(message.counters, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.errorBreakdowns != null && message.errorBreakdowns.length) + for (var i = 0; i < message.errorBreakdowns.length; ++i) + $root.google.storagetransfer.v1.ErrorSummary.encode(message.errorBreakdowns[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.transferJobName != null && Object.hasOwnProperty.call(message, "transferJobName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.transferJobName); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.storagetransfer.v1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferOperation message, length delimited. Does not implicitly {@link google.storagetransfer.v1.TransferOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {google.storagetransfer.v1.ITransferOperation} message TransferOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferOperation message from the specified reader or buffer. + * @function decode + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOperation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.storagetransfer.v1.TransferOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.decode(reader, reader.uint32()); + break; + } + case 10: { + message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.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.status = reader.int32(); + break; + } + case 7: { + message.counters = $root.google.storagetransfer.v1.TransferCounters.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.errorBreakdowns && message.errorBreakdowns.length)) + message.errorBreakdowns = []; + message.errorBreakdowns.push($root.google.storagetransfer.v1.ErrorSummary.decode(reader, reader.uint32())); + break; + } + case 9: { + message.transferJobName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferOperation message. + * @function verify + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) { + var error = $root.google.storagetransfer.v1.TransferSpec.verify(message.transferSpec); + if (error) + return "transferSpec." + error; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.storagetransfer.v1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + 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.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.counters != null && message.hasOwnProperty("counters")) { + var error = $root.google.storagetransfer.v1.TransferCounters.verify(message.counters); + if (error) + return "counters." + error; + } + if (message.errorBreakdowns != null && message.hasOwnProperty("errorBreakdowns")) { + if (!Array.isArray(message.errorBreakdowns)) + return "errorBreakdowns: array expected"; + for (var i = 0; i < message.errorBreakdowns.length; ++i) { + var error = $root.google.storagetransfer.v1.ErrorSummary.verify(message.errorBreakdowns[i]); + if (error) + return "errorBreakdowns." + error; + } + } + if (message.transferJobName != null && message.hasOwnProperty("transferJobName")) + if (!$util.isString(message.transferJobName)) + return "transferJobName: string expected"; + return null; + }; + + /** + * Creates a TransferOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {Object.} object Plain object + * @returns {google.storagetransfer.v1.TransferOperation} TransferOperation + */ + TransferOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.storagetransfer.v1.TransferOperation) + return object; + var message = new $root.google.storagetransfer.v1.TransferOperation(); + if (object.name != null) + message.name = String(object.name); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.transferSpec != null) { + if (typeof object.transferSpec !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.transferSpec: object expected"); + message.transferSpec = $root.google.storagetransfer.v1.TransferSpec.fromObject(object.transferSpec); + } + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.notificationConfig: object expected"); + message.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "IN_PROGRESS": + case 1: + message.status = 1; + break; + case "PAUSED": + case 2: + message.status = 2; + break; + case "SUCCESS": + case 3: + message.status = 3; + break; + case "FAILED": + case 4: + message.status = 4; + break; + case "ABORTED": + case 5: + message.status = 5; + break; + case "QUEUED": + case 6: + message.status = 6; + break; + } + if (object.counters != null) { + if (typeof object.counters !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.counters: object expected"); + message.counters = $root.google.storagetransfer.v1.TransferCounters.fromObject(object.counters); + } + if (object.errorBreakdowns) { + if (!Array.isArray(object.errorBreakdowns)) + throw TypeError(".google.storagetransfer.v1.TransferOperation.errorBreakdowns: array expected"); + message.errorBreakdowns = []; + for (var i = 0; i < object.errorBreakdowns.length; ++i) { + if (typeof object.errorBreakdowns[i] !== "object") + throw TypeError(".google.storagetransfer.v1.TransferOperation.errorBreakdowns: object expected"); + message.errorBreakdowns[i] = $root.google.storagetransfer.v1.ErrorSummary.fromObject(object.errorBreakdowns[i]); + } + } + if (object.transferJobName != null) + message.transferJobName = String(object.transferJobName); + return message; + }; + + /** + * Creates a plain object from a TransferOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {google.storagetransfer.v1.TransferOperation} message TransferOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errorBreakdowns = []; + if (options.defaults) { + object.name = ""; + object.projectId = ""; + object.transferSpec = null; + object.startTime = null; + object.endTime = null; + object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; + object.counters = null; + object.transferJobName = ""; + object.notificationConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.transferSpec != null && message.hasOwnProperty("transferSpec")) + object.transferSpec = $root.google.storagetransfer.v1.TransferSpec.toObject(message.transferSpec, 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.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.storagetransfer.v1.TransferOperation.Status[message.status] === undefined ? message.status : $root.google.storagetransfer.v1.TransferOperation.Status[message.status] : message.status; + if (message.counters != null && message.hasOwnProperty("counters")) + object.counters = $root.google.storagetransfer.v1.TransferCounters.toObject(message.counters, options); + if (message.errorBreakdowns && message.errorBreakdowns.length) { + object.errorBreakdowns = []; + for (var j = 0; j < message.errorBreakdowns.length; ++j) + object.errorBreakdowns[j] = $root.google.storagetransfer.v1.ErrorSummary.toObject(message.errorBreakdowns[j], options); + } + if (message.transferJobName != null && message.hasOwnProperty("transferJobName")) + object.transferJobName = message.transferJobName; + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.storagetransfer.v1.NotificationConfig.toObject(message.notificationConfig, options); + return object; + }; + + /** + * Converts this TransferOperation to JSON. + * @function toJSON + * @memberof google.storagetransfer.v1.TransferOperation + * @instance + * @returns {Object.} JSON object + */ + TransferOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferOperation + * @function getTypeUrl + * @memberof google.storagetransfer.v1.TransferOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.storagetransfer.v1.TransferOperation"; + }; + + /** + * Status enum. + * @name google.storagetransfer.v1.TransferOperation.Status + * @enum {number} + * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} PAUSED=2 PAUSED value + * @property {number} SUCCESS=3 SUCCESS value + * @property {number} FAILED=4 FAILED value + * @property {number} ABORTED=5 ABORTED value + * @property {number} QUEUED=6 QUEUED value + */ + TransferOperation.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "PAUSED"] = 2; + values[valuesById[3] = "SUCCESS"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "ABORTED"] = 5; + values[valuesById[6] = "QUEUED"] = 6; + return values; + })(); + + return TransferOperation; + })(); + + return v1; + })(); + + return storagetransfer; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + /** + * Code enum. + * @name google.rpc.Code + * @enum {number} + * @property {number} OK=0 OK value + * @property {number} CANCELLED=1 CANCELLED value + * @property {number} UNKNOWN=2 UNKNOWN value + * @property {number} INVALID_ARGUMENT=3 INVALID_ARGUMENT value + * @property {number} DEADLINE_EXCEEDED=4 DEADLINE_EXCEEDED value + * @property {number} NOT_FOUND=5 NOT_FOUND value + * @property {number} ALREADY_EXISTS=6 ALREADY_EXISTS value + * @property {number} PERMISSION_DENIED=7 PERMISSION_DENIED value + * @property {number} UNAUTHENTICATED=16 UNAUTHENTICATED value + * @property {number} RESOURCE_EXHAUSTED=8 RESOURCE_EXHAUSTED value + * @property {number} FAILED_PRECONDITION=9 FAILED_PRECONDITION value + * @property {number} ABORTED=10 ABORTED value + * @property {number} OUT_OF_RANGE=11 OUT_OF_RANGE value + * @property {number} UNIMPLEMENTED=12 UNIMPLEMENTED value + * @property {number} INTERNAL=13 INTERNAL value + * @property {number} UNAVAILABLE=14 UNAVAILABLE value + * @property {number} DATA_LOSS=15 DATA_LOSS value + */ + rpc.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OK"] = 0; + values[valuesById[1] = "CANCELLED"] = 1; + values[valuesById[2] = "UNKNOWN"] = 2; + values[valuesById[3] = "INVALID_ARGUMENT"] = 3; + values[valuesById[4] = "DEADLINE_EXCEEDED"] = 4; + values[valuesById[5] = "NOT_FOUND"] = 5; + values[valuesById[6] = "ALREADY_EXISTS"] = 6; + values[valuesById[7] = "PERMISSION_DENIED"] = 7; + values[valuesById[16] = "UNAUTHENTICATED"] = 16; + values[valuesById[8] = "RESOURCE_EXHAUSTED"] = 8; + values[valuesById[9] = "FAILED_PRECONDITION"] = 9; + values[valuesById[10] = "ABORTED"] = 10; + values[valuesById[11] = "OUT_OF_RANGE"] = 11; + values[valuesById[12] = "UNIMPLEMENTED"] = 12; + values[valuesById[13] = "INTERNAL"] = 13; + values[valuesById[14] = "UNAVAILABLE"] = 14; + values[valuesById[15] = "DATA_LOSS"] = 15; + return values; + })(); + + return rpc; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + type.TimeOfDay = (function() { + + /** + * Properties of a TimeOfDay. + * @memberof google.type + * @interface ITimeOfDay + * @property {number|null} [hours] TimeOfDay hours + * @property {number|null} [minutes] TimeOfDay minutes + * @property {number|null} [seconds] TimeOfDay seconds + * @property {number|null} [nanos] TimeOfDay nanos + */ + + /** + * Constructs a new TimeOfDay. + * @memberof google.type + * @classdesc Represents a TimeOfDay. + * @implements ITimeOfDay + * @constructor + * @param {google.type.ITimeOfDay=} [properties] Properties to set + */ + function TimeOfDay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeOfDay hours. + * @member {number} hours + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.hours = 0; + + /** + * TimeOfDay minutes. + * @member {number} minutes + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.minutes = 0; + + /** + * TimeOfDay seconds. + * @member {number} seconds + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.seconds = 0; + + /** + * TimeOfDay nanos. + * @member {number} nanos + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.nanos = 0; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @function create + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay=} [properties] Properties to set + * @returns {google.type.TimeOfDay} TimeOfDay instance + */ + TimeOfDay.create = function create(properties) { + return new TimeOfDay(properties); + }; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encode + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @function decode + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.TimeOfDay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hours = reader.int32(); + break; + } + case 2: { + message.minutes = reader.int32(); + break; + } + case 3: { + message.seconds = reader.int32(); + break; + } + case 4: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeOfDay message. + * @function verify + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeOfDay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeOfDay} TimeOfDay + */ + TimeOfDay.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeOfDay) + return object; + var message = new $root.google.type.TimeOfDay(); + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.TimeOfDay} message TimeOfDay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeOfDay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this TimeOfDay to JSON. + * @function toJSON + * @memberof google.type.TimeOfDay + * @instance + * @returns {Object.} JSON object + */ + TimeOfDay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeOfDay + * @function getTypeUrl + * @memberof google.type.TimeOfDay + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeOfDay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.TimeOfDay"; + }; + + return TimeOfDay; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-storagetransfer/protos/protos.json b/packages/google-storagetransfer/protos/protos.json new file mode 100644 index 00000000000..47e8e617ad3 --- /dev/null +++ b/packages/google-storagetransfer/protos/protos.json @@ -0,0 +1,2920 @@ +{ + "nested": { + "google": { + "nested": { + "storagetransfer": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.StorageTransfer.V1", + "go_package": "google.golang.org/genproto/googleapis/storagetransfer/v1;storagetransfer", + "java_outer_classname": "TransferTypes", + "java_package": "com.google.storagetransfer.v1.proto", + "php_namespace": "Google\\Cloud\\StorageTransfer\\V1", + "ruby_package": "Google::Cloud::StorageTransfer::V1" + }, + "nested": { + "StorageTransferService": { + "options": { + "(google.api.default_host)": "storagetransfer.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetGoogleServiceAccount": { + "requestType": "GetGoogleServiceAccountRequest", + "responseType": "GoogleServiceAccount", + "options": { + "(google.api.http).get": "/v1/googleServiceAccounts/{project_id}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/googleServiceAccounts/{project_id}" + } + } + ] + }, + "CreateTransferJob": { + "requestType": "CreateTransferJobRequest", + "responseType": "TransferJob", + "options": { + "(google.api.http).post": "/v1/transferJobs", + "(google.api.http).body": "transfer_job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/transferJobs", + "body": "transfer_job" + } + } + ] + }, + "UpdateTransferJob": { + "requestType": "UpdateTransferJobRequest", + "responseType": "TransferJob", + "options": { + "(google.api.http).patch": "/v1/{job_name=transferJobs/**}", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{job_name=transferJobs/**}", + "body": "*" + } + } + ] + }, + "GetTransferJob": { + "requestType": "GetTransferJobRequest", + "responseType": "TransferJob", + "options": { + "(google.api.http).get": "/v1/{job_name=transferJobs/**}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{job_name=transferJobs/**}" + } + } + ] + }, + "ListTransferJobs": { + "requestType": "ListTransferJobsRequest", + "responseType": "ListTransferJobsResponse", + "options": { + "(google.api.http).get": "/v1/transferJobs" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/transferJobs" + } + } + ] + }, + "PauseTransferOperation": { + "requestType": "PauseTransferOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=transferOperations/**}:pause", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=transferOperations/**}:pause", + "body": "*" + } + } + ] + }, + "ResumeTransferOperation": { + "requestType": "ResumeTransferOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=transferOperations/**}:resume", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=transferOperations/**}:resume", + "body": "*" + } + } + ] + }, + "RunTransferJob": { + "requestType": "RunTransferJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{job_name=transferJobs/**}:run", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "TransferOperation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{job_name=transferJobs/**}:run", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "TransferOperation" + } + } + ] + }, + "DeleteTransferJob": { + "requestType": "DeleteTransferJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{job_name=transferJobs/**}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{job_name=transferJobs/**}" + } + } + ] + }, + "CreateAgentPool": { + "requestType": "CreateAgentPoolRequest", + "responseType": "AgentPool", + "options": { + "(google.api.http).post": "/v1/projects/{project_id=*}/agentPools", + "(google.api.http).body": "agent_pool", + "(google.api.method_signature)": "project_id,agent_pool,agent_pool_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id=*}/agentPools", + "body": "agent_pool" + } + }, + { + "(google.api.method_signature)": "project_id,agent_pool,agent_pool_id" + } + ] + }, + "UpdateAgentPool": { + "requestType": "UpdateAgentPoolRequest", + "responseType": "AgentPool", + "options": { + "(google.api.http).patch": "/v1/{agent_pool.name=projects/*/agentPools/*}", + "(google.api.http).body": "agent_pool", + "(google.api.method_signature)": "agent_pool,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{agent_pool.name=projects/*/agentPools/*}", + "body": "agent_pool" + } + }, + { + "(google.api.method_signature)": "agent_pool,update_mask" + } + ] + }, + "GetAgentPool": { + "requestType": "GetAgentPoolRequest", + "responseType": "AgentPool", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/agentPools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/agentPools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAgentPools": { + "requestType": "ListAgentPoolsRequest", + "responseType": "ListAgentPoolsResponse", + "options": { + "(google.api.http).get": "/v1/projects/{project_id=*}/agentPools", + "(google.api.method_signature)": "project_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/projects/{project_id=*}/agentPools" + } + }, + { + "(google.api.method_signature)": "project_id" + } + ] + }, + "DeleteAgentPool": { + "requestType": "DeleteAgentPoolRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/agentPools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/agentPools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "GetGoogleServiceAccountRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateTransferJobRequest": { + "fields": { + "transferJob": { + "type": "TransferJob", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateTransferJobRequest": { + "fields": { + "jobName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "projectId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "transferJob": { + "type": "TransferJob", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateTransferJobFieldMask": { + "type": "google.protobuf.FieldMask", + "id": 4 + } + } + }, + "GetTransferJobRequest": { + "fields": { + "jobName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "projectId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteTransferJobRequest": { + "fields": { + "jobName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "projectId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListTransferJobsRequest": { + "fields": { + "filter": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ListTransferJobsResponse": { + "fields": { + "transferJobs": { + "rule": "repeated", + "type": "TransferJob", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "PauseTransferOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ResumeTransferOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RunTransferJobRequest": { + "fields": { + "jobName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "projectId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateAgentPoolRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "agentPool": { + "type": "AgentPool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "agentPoolId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAgentPoolRequest": { + "fields": { + "agentPool": { + "type": "AgentPool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetAgentPoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteAgentPoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListAgentPoolsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListAgentPoolsResponse": { + "fields": { + "agentPools": { + "rule": "repeated", + "type": "AgentPool", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GoogleServiceAccount": { + "fields": { + "accountEmail": { + "type": "string", + "id": 1 + }, + "subjectId": { + "type": "string", + "id": 2 + } + } + }, + "AwsAccessKey": { + "fields": { + "accessKeyId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "secretAccessKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AzureCredentials": { + "fields": { + "sasToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ObjectConditions": { + "fields": { + "minTimeElapsedSinceLastModification": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "maxTimeElapsedSinceLastModification": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "includePrefixes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "excludePrefixes": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "lastModifiedSince": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "lastModifiedBefore": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + } + }, + "GcsData": { + "fields": { + "bucketName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "path": { + "type": "string", + "id": 3 + } + } + }, + "AwsS3Data": { + "fields": { + "bucketName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "awsAccessKey": { + "type": "AwsAccessKey", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "path": { + "type": "string", + "id": 3 + }, + "roleArn": { + "type": "string", + "id": 4 + } + } + }, + "AzureBlobStorageData": { + "fields": { + "storageAccount": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "azureCredentials": { + "type": "AzureCredentials", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "container": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "path": { + "type": "string", + "id": 5 + } + } + }, + "HttpData": { + "fields": { + "listUrl": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PosixFilesystem": { + "fields": { + "rootDirectory": { + "type": "string", + "id": 1 + } + } + }, + "AwsS3CompatibleData": { + "oneofs": { + "dataProvider": { + "oneof": [ + "s3Metadata" + ] + } + }, + "fields": { + "bucketName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "path": { + "type": "string", + "id": 2 + }, + "endpoint": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 5 + }, + "s3Metadata": { + "type": "S3CompatibleMetadata", + "id": 4 + } + } + }, + "S3CompatibleMetadata": { + "fields": { + "authMethod": { + "type": "AuthMethod", + "id": 1 + }, + "requestModel": { + "type": "RequestModel", + "id": 2 + }, + "protocol": { + "type": "NetworkProtocol", + "id": 3 + }, + "listApi": { + "type": "ListApi", + "id": 4 + } + }, + "nested": { + "AuthMethod": { + "values": { + "AUTH_METHOD_UNSPECIFIED": 0, + "AUTH_METHOD_AWS_SIGNATURE_V4": 1, + "AUTH_METHOD_AWS_SIGNATURE_V2": 2 + } + }, + "RequestModel": { + "values": { + "REQUEST_MODEL_UNSPECIFIED": 0, + "REQUEST_MODEL_VIRTUAL_HOSTED_STYLE": 1, + "REQUEST_MODEL_PATH_STYLE": 2 + } + }, + "NetworkProtocol": { + "values": { + "NETWORK_PROTOCOL_UNSPECIFIED": 0, + "NETWORK_PROTOCOL_HTTPS": 1, + "NETWORK_PROTOCOL_HTTP": 2 + } + }, + "ListApi": { + "values": { + "LIST_API_UNSPECIFIED": 0, + "LIST_OBJECTS_V2": 1, + "LIST_OBJECTS": 2 + } + } + } + }, + "AgentPool": { + "options": { + "(google.api.resource).type": "storagetransfer.googleapis.com/agentPools", + "(google.api.resource).pattern": "projects/{project_id}/agentPools/{agent_pool_id}" + }, + "fields": { + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "bandwidthLimit": { + "type": "BandwidthLimit", + "id": 5 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "CREATED": 2, + "DELETING": 3 + } + }, + "BandwidthLimit": { + "fields": { + "limitMbps": { + "type": "int64", + "id": 1 + } + } + } + } + }, + "TransferOptions": { + "fields": { + "overwriteObjectsAlreadyExistingInSink": { + "type": "bool", + "id": 1 + }, + "deleteObjectsUniqueInSink": { + "type": "bool", + "id": 2 + }, + "deleteObjectsFromSourceAfterTransfer": { + "type": "bool", + "id": 3 + }, + "overwriteWhen": { + "type": "OverwriteWhen", + "id": 4 + }, + "metadataOptions": { + "type": "MetadataOptions", + "id": 5 + } + }, + "nested": { + "OverwriteWhen": { + "values": { + "OVERWRITE_WHEN_UNSPECIFIED": 0, + "DIFFERENT": 1, + "NEVER": 2, + "ALWAYS": 3 + } + } + } + }, + "TransferSpec": { + "oneofs": { + "dataSink": { + "oneof": [ + "gcsDataSink", + "posixDataSink" + ] + }, + "dataSource": { + "oneof": [ + "gcsDataSource", + "awsS3DataSource", + "httpDataSource", + "posixDataSource", + "azureBlobStorageDataSource", + "awsS3CompatibleDataSource" + ] + }, + "intermediateDataLocation": { + "oneof": [ + "gcsIntermediateDataLocation" + ] + } + }, + "fields": { + "gcsDataSink": { + "type": "GcsData", + "id": 4 + }, + "posixDataSink": { + "type": "PosixFilesystem", + "id": 13 + }, + "gcsDataSource": { + "type": "GcsData", + "id": 1 + }, + "awsS3DataSource": { + "type": "AwsS3Data", + "id": 2 + }, + "httpDataSource": { + "type": "HttpData", + "id": 3 + }, + "posixDataSource": { + "type": "PosixFilesystem", + "id": 14 + }, + "azureBlobStorageDataSource": { + "type": "AzureBlobStorageData", + "id": 8 + }, + "awsS3CompatibleDataSource": { + "type": "AwsS3CompatibleData", + "id": 19 + }, + "gcsIntermediateDataLocation": { + "type": "GcsData", + "id": 16 + }, + "objectConditions": { + "type": "ObjectConditions", + "id": 5 + }, + "transferOptions": { + "type": "TransferOptions", + "id": 6 + }, + "transferManifest": { + "type": "TransferManifest", + "id": 15 + }, + "sourceAgentPoolName": { + "type": "string", + "id": 17 + }, + "sinkAgentPoolName": { + "type": "string", + "id": 18 + } + } + }, + "MetadataOptions": { + "fields": { + "symlink": { + "type": "Symlink", + "id": 1 + }, + "mode": { + "type": "Mode", + "id": 2 + }, + "gid": { + "type": "GID", + "id": 3 + }, + "uid": { + "type": "UID", + "id": 4 + }, + "acl": { + "type": "Acl", + "id": 5 + }, + "storageClass": { + "type": "StorageClass", + "id": 6 + }, + "temporaryHold": { + "type": "TemporaryHold", + "id": 7 + }, + "kmsKey": { + "type": "KmsKey", + "id": 8 + }, + "timeCreated": { + "type": "TimeCreated", + "id": 9 + } + }, + "nested": { + "Symlink": { + "values": { + "SYMLINK_UNSPECIFIED": 0, + "SYMLINK_SKIP": 1, + "SYMLINK_PRESERVE": 2 + } + }, + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "MODE_SKIP": 1, + "MODE_PRESERVE": 2 + } + }, + "GID": { + "values": { + "GID_UNSPECIFIED": 0, + "GID_SKIP": 1, + "GID_NUMBER": 2 + } + }, + "UID": { + "values": { + "UID_UNSPECIFIED": 0, + "UID_SKIP": 1, + "UID_NUMBER": 2 + } + }, + "Acl": { + "values": { + "ACL_UNSPECIFIED": 0, + "ACL_DESTINATION_BUCKET_DEFAULT": 1, + "ACL_PRESERVE": 2 + } + }, + "StorageClass": { + "values": { + "STORAGE_CLASS_UNSPECIFIED": 0, + "STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT": 1, + "STORAGE_CLASS_PRESERVE": 2, + "STORAGE_CLASS_STANDARD": 3, + "STORAGE_CLASS_NEARLINE": 4, + "STORAGE_CLASS_COLDLINE": 5, + "STORAGE_CLASS_ARCHIVE": 6 + } + }, + "TemporaryHold": { + "values": { + "TEMPORARY_HOLD_UNSPECIFIED": 0, + "TEMPORARY_HOLD_SKIP": 1, + "TEMPORARY_HOLD_PRESERVE": 2 + } + }, + "KmsKey": { + "values": { + "KMS_KEY_UNSPECIFIED": 0, + "KMS_KEY_DESTINATION_BUCKET_DEFAULT": 1, + "KMS_KEY_PRESERVE": 2 + } + }, + "TimeCreated": { + "values": { + "TIME_CREATED_UNSPECIFIED": 0, + "TIME_CREATED_SKIP": 1, + "TIME_CREATED_PRESERVE_AS_CUSTOM_TIME": 2 + } + } + } + }, + "TransferManifest": { + "fields": { + "location": { + "type": "string", + "id": 1 + } + } + }, + "Schedule": { + "fields": { + "scheduleStartDate": { + "type": "google.type.Date", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scheduleEndDate": { + "type": "google.type.Date", + "id": 2 + }, + "startTimeOfDay": { + "type": "google.type.TimeOfDay", + "id": 3 + }, + "endTimeOfDay": { + "type": "google.type.TimeOfDay", + "id": 4 + }, + "repeatInterval": { + "type": "google.protobuf.Duration", + "id": 5 + } + } + }, + "TransferJob": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "projectId": { + "type": "string", + "id": 3 + }, + "transferSpec": { + "type": "TransferSpec", + "id": 4 + }, + "notificationConfig": { + "type": "NotificationConfig", + "id": 11 + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 14 + }, + "schedule": { + "type": "Schedule", + "id": 5 + }, + "status": { + "type": "Status", + "id": 6 + }, + "creationTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastModificationTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deletionTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latestOperationName": { + "type": "string", + "id": 12 + } + }, + "nested": { + "Status": { + "values": { + "STATUS_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2, + "DELETED": 3 + } + } + } + }, + "ErrorLogEntry": { + "fields": { + "url": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "errorDetails": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ErrorSummary": { + "fields": { + "errorCode": { + "type": "google.rpc.Code", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "errorCount": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "errorLogEntries": { + "rule": "repeated", + "type": "ErrorLogEntry", + "id": 3 + } + } + }, + "TransferCounters": { + "fields": { + "objectsFoundFromSource": { + "type": "int64", + "id": 1 + }, + "bytesFoundFromSource": { + "type": "int64", + "id": 2 + }, + "objectsFoundOnlyFromSink": { + "type": "int64", + "id": 3 + }, + "bytesFoundOnlyFromSink": { + "type": "int64", + "id": 4 + }, + "objectsFromSourceSkippedBySync": { + "type": "int64", + "id": 5 + }, + "bytesFromSourceSkippedBySync": { + "type": "int64", + "id": 6 + }, + "objectsCopiedToSink": { + "type": "int64", + "id": 7 + }, + "bytesCopiedToSink": { + "type": "int64", + "id": 8 + }, + "objectsDeletedFromSource": { + "type": "int64", + "id": 9 + }, + "bytesDeletedFromSource": { + "type": "int64", + "id": 10 + }, + "objectsDeletedFromSink": { + "type": "int64", + "id": 11 + }, + "bytesDeletedFromSink": { + "type": "int64", + "id": 12 + }, + "objectsFromSourceFailed": { + "type": "int64", + "id": 13 + }, + "bytesFromSourceFailed": { + "type": "int64", + "id": 14 + }, + "objectsFailedToDeleteFromSink": { + "type": "int64", + "id": 15 + }, + "bytesFailedToDeleteFromSink": { + "type": "int64", + "id": 16 + }, + "directoriesFoundFromSource": { + "type": "int64", + "id": 17 + }, + "directoriesFailedToListFromSource": { + "type": "int64", + "id": 18 + }, + "directoriesSuccessfullyListedFromSource": { + "type": "int64", + "id": 19 + }, + "intermediateObjectsCleanedUp": { + "type": "int64", + "id": 22 + }, + "intermediateObjectsFailedCleanedUp": { + "type": "int64", + "id": 23 + } + } + }, + "NotificationConfig": { + "fields": { + "pubsubTopic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "eventTypes": { + "rule": "repeated", + "type": "EventType", + "id": 2 + }, + "payloadFormat": { + "type": "PayloadFormat", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "EventType": { + "values": { + "EVENT_TYPE_UNSPECIFIED": 0, + "TRANSFER_OPERATION_SUCCESS": 1, + "TRANSFER_OPERATION_FAILED": 2, + "TRANSFER_OPERATION_ABORTED": 3 + } + }, + "PayloadFormat": { + "values": { + "PAYLOAD_FORMAT_UNSPECIFIED": 0, + "NONE": 1, + "JSON": 2 + } + } + } + }, + "LoggingConfig": { + "fields": { + "logActions": { + "rule": "repeated", + "type": "LoggableAction", + "id": 1 + }, + "logActionStates": { + "rule": "repeated", + "type": "LoggableActionState", + "id": 2 + }, + "enableOnpremGcsTransferLogs": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "LoggableAction": { + "values": { + "LOGGABLE_ACTION_UNSPECIFIED": 0, + "FIND": 1, + "DELETE": 2, + "COPY": 3 + } + }, + "LoggableActionState": { + "values": { + "LOGGABLE_ACTION_STATE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2 + } + } + } + }, + "TransferOperation": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "transferSpec": { + "type": "TransferSpec", + "id": 3 + }, + "notificationConfig": { + "type": "NotificationConfig", + "id": 10 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "status": { + "type": "Status", + "id": 6 + }, + "counters": { + "type": "TransferCounters", + "id": 7 + }, + "errorBreakdowns": { + "rule": "repeated", + "type": "ErrorSummary", + "id": 8 + }, + "transferJobName": { + "type": "string", + "id": 9 + } + }, + "nested": { + "Status": { + "values": { + "STATUS_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "PAUSED": 2, + "SUCCESS": 3, + "FAILED": 4, + "ABORTED": 5, + "QUEUED": 6 + } + } + } + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/code;code", + "java_multiple_files": true, + "java_outer_classname": "CodeProto", + "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 + } + } + }, + "Code": { + "values": { + "OK": 0, + "CANCELLED": 1, + "UNKNOWN": 2, + "INVALID_ARGUMENT": 3, + "DEADLINE_EXCEEDED": 4, + "NOT_FOUND": 5, + "ALREADY_EXISTS": 6, + "PERMISSION_DENIED": 7, + "UNAUTHENTICATED": 16, + "RESOURCE_EXHAUSTED": 8, + "FAILED_PRECONDITION": 9, + "ABORTED": 10, + "OUT_OF_RANGE": 11, + "UNIMPLEMENTED": 12, + "INTERNAL": 13, + "UNAVAILABLE": 14, + "DATA_LOSS": 15 + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/timeofday;timeofday", + "java_multiple_files": true, + "java_outer_classname": "TimeOfDayProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + }, + "TimeOfDay": { + "fields": { + "hours": { + "type": "int32", + "id": 1 + }, + "minutes": { + "type": "int32", + "id": 2 + }, + "seconds": { + "type": "int32", + "id": 3 + }, + "nanos": { + "type": "int32", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-storagetransfer/samples/README.md b/packages/google-storagetransfer/samples/README.md new file mode 100644 index 00000000000..2670568aa3e --- /dev/null +++ b/packages/google-storagetransfer/samples/README.md @@ -0,0 +1,230 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Storage Transfer Service: Node.js Samples](https://github.com/googleapis/nodejs-storage-transfer) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Aws-request](#aws-request) + * [Aws-s3-compatible-source-request](#aws-s3-compatible-source-request) + * [Check-latest-transfer-operation](#check-latest-transfer-operation) + * [Get-transfer-job-with-retries](#get-transfer-job-with-retries) + * [Manifest-request](#manifest-request) + * [Nearline-request](#nearline-request) + * [Posix-download](#posix-download) + * [Posix-request](#posix-request) + * [Posix-to-posix-request](#posix-to-posix-request) + * [Quickstart](#quickstart) + * [Transfer-check](#transfer-check) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-storage-transfer#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Aws-request + +View the [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/aws-request.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/aws-request.js,samples/README.md) + +__Usage:__ + + +`node samples/aws-request.js` + + +----- + + + + +### Aws-s3-compatible-source-request + +View the [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/aws-s3-compatible-source-request.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/aws-s3-compatible-source-request.js,samples/README.md) + +__Usage:__ + + +`node samples/aws-s3-compatible-source-request.js` + + +----- + + + + +### Check-latest-transfer-operation + +View the [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/check-latest-transfer-operation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/check-latest-transfer-operation.js,samples/README.md) + +__Usage:__ + + +`node samples/check-latest-transfer-operation.js` + + +----- + + + + +### Get-transfer-job-with-retries + +View the [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/get-transfer-job-with-retries.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/get-transfer-job-with-retries.js,samples/README.md) + +__Usage:__ + + +`node samples/get-transfer-job-with-retries.js` + + +----- + + + + +### Manifest-request + +View the [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/manifest-request.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/manifest-request.js,samples/README.md) + +__Usage:__ + + +`node samples/manifest-request.js` + + +----- + + + + +### Nearline-request + +View the [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/nearline-request.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/nearline-request.js,samples/README.md) + +__Usage:__ + + +`node samples/nearline-request.js` + + +----- + + + + +### Posix-download + +View the [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/posix-download.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/posix-download.js,samples/README.md) + +__Usage:__ + + +`node samples/posix-download.js` + + +----- + + + + +### Posix-request + +View the [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/posix-request.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/posix-request.js,samples/README.md) + +__Usage:__ + + +`node samples/posix-request.js` + + +----- + + + + +### Posix-to-posix-request + +View the [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/posix-to-posix-request.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/posix-to-posix-request.js,samples/README.md) + +__Usage:__ + + +`node samples/posix-to-posix-request.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + +----- + + + + +### Transfer-check + +View the [source code](https://github.com/googleapis/nodejs-storage-transfer/blob/main/samples/transfer-check.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/transfer-check.js,samples/README.md) + +__Usage:__ + + +`node samples/transfer-check.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage-transfer&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/storage-transfer/ diff --git a/packages/google-storagetransfer/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json b/packages/google-storagetransfer/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json new file mode 100644 index 00000000000..9f7c418ef45 --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/snippet_metadata.google.storagetransfer.v1.json @@ -0,0 +1,631 @@ +{ + "clientLibrary": { + "name": "nodejs-storagetransfer", + "version": "2.2.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.storagetransfer.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async", + "title": "StorageTransferService getGoogleServiceAccount Sample", + "origin": "API_DEFINITION", + "description": " Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.", + "canonical": true, + "file": "storage_transfer_service.get_google_service_account.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGoogleServiceAccount", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetGoogleServiceAccount", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.GoogleServiceAccount", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "GetGoogleServiceAccount", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetGoogleServiceAccount", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async", + "title": "StorageTransferService createTransferJob Sample", + "origin": "API_DEFINITION", + "description": " Creates a transfer job that runs periodically.", + "canonical": true, + "file": "storage_transfer_service.create_transfer_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.CreateTransferJob", + "async": true, + "parameters": [ + { + "name": "transfer_job", + "type": ".google.storagetransfer.v1.TransferJob" + } + ], + "resultType": ".google.storagetransfer.v1.TransferJob", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "CreateTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.CreateTransferJob", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async", + "title": "StorageTransferService updateTransferJob Sample", + "origin": "API_DEFINITION", + "description": " Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already. **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified using this RPC (for example, to set a job's status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).", + "canonical": true, + "file": "storage_transfer_service.update_transfer_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateTransferJob", + "async": true, + "parameters": [ + { + "name": "job_name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "transfer_job", + "type": ".google.storagetransfer.v1.TransferJob" + }, + { + "name": "update_transfer_job_field_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.storagetransfer.v1.TransferJob", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "UpdateTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateTransferJob", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async", + "title": "StorageTransferService getTransferJob Sample", + "origin": "API_DEFINITION", + "description": " Gets a transfer job.", + "canonical": true, + "file": "storage_transfer_service.get_transfer_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetTransferJob", + "async": true, + "parameters": [ + { + "name": "job_name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.TransferJob", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "GetTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetTransferJob", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async", + "title": "StorageTransferService listTransferJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists transfer jobs.", + "canonical": true, + "file": "storage_transfer_service.list_transfer_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTransferJobs", + "fullName": "google.storagetransfer.v1.StorageTransferService.ListTransferJobs", + "async": true, + "parameters": [ + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.ListTransferJobsResponse", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "ListTransferJobs", + "fullName": "google.storagetransfer.v1.StorageTransferService.ListTransferJobs", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async", + "title": "StorageTransferService pauseTransferOperation Sample", + "origin": "API_DEFINITION", + "description": " Pauses a transfer operation.", + "canonical": true, + "file": "storage_transfer_service.pause_transfer_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PauseTransferOperation", + "fullName": "google.storagetransfer.v1.StorageTransferService.PauseTransferOperation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "PauseTransferOperation", + "fullName": "google.storagetransfer.v1.StorageTransferService.PauseTransferOperation", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async", + "title": "StorageTransferService resumeTransferOperation Sample", + "origin": "API_DEFINITION", + "description": " Resumes a transfer operation that is paused.", + "canonical": true, + "file": "storage_transfer_service.resume_transfer_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResumeTransferOperation", + "fullName": "google.storagetransfer.v1.StorageTransferService.ResumeTransferOperation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "ResumeTransferOperation", + "fullName": "google.storagetransfer.v1.StorageTransferService.ResumeTransferOperation", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async", + "title": "StorageTransferService runTransferJob Sample", + "origin": "API_DEFINITION", + "description": " Attempts to start a new TransferOperation for the current TransferJob. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error will be returned.", + "canonical": true, + "file": "storage_transfer_service.run_transfer_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.RunTransferJob", + "async": true, + "parameters": [ + { + "name": "job_name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "RunTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.RunTransferJob", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_async", + "title": "StorageTransferService deleteTransferJob Sample", + "origin": "API_DEFINITION", + "description": " Deletes a transfer job. Deleting a transfer job sets its status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].", + "canonical": true, + "file": "storage_transfer_service.delete_transfer_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteTransferJob", + "async": true, + "parameters": [ + { + "name": "job_name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "DeleteTransferJob", + "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteTransferJob", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async", + "title": "StorageTransferService createAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Creates an agent pool resource.", + "canonical": true, + "file": "storage_transfer_service.create_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.CreateAgentPool", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "agent_pool", + "type": ".google.storagetransfer.v1.AgentPool" + }, + { + "name": "agent_pool_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.AgentPool", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "CreateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.CreateAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async", + "title": "StorageTransferService updateAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing agent pool resource.", + "canonical": true, + "file": "storage_transfer_service.update_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateAgentPool", + "async": true, + "parameters": [ + { + "name": "agent_pool", + "type": ".google.storagetransfer.v1.AgentPool" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.storagetransfer.v1.AgentPool", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "UpdateAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.UpdateAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async", + "title": "StorageTransferService getAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Gets an agent pool.", + "canonical": true, + "file": "storage_transfer_service.get_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetAgentPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.AgentPool", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "GetAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.GetAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async", + "title": "StorageTransferService listAgentPools Sample", + "origin": "API_DEFINITION", + "description": " Lists agent pools.", + "canonical": true, + "file": "storage_transfer_service.list_agent_pools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAgentPools", + "fullName": "google.storagetransfer.v1.StorageTransferService.ListAgentPools", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.storagetransfer.v1.ListAgentPoolsResponse", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "ListAgentPools", + "fullName": "google.storagetransfer.v1.StorageTransferService.ListAgentPools", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + }, + { + "regionTag": "storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async", + "title": "StorageTransferService deleteAgentPool Sample", + "origin": "API_DEFINITION", + "description": " Deletes an agent pool.", + "canonical": true, + "file": "storage_transfer_service.delete_agent_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteAgentPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "StorageTransferServiceClient", + "fullName": "google.storagetransfer.v1.StorageTransferServiceClient" + }, + "method": { + "shortName": "DeleteAgentPool", + "fullName": "google.storagetransfer.v1.StorageTransferService.DeleteAgentPool", + "service": { + "shortName": "StorageTransferService", + "fullName": "google.storagetransfer.v1.StorageTransferService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.create_agent_pool.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.create_agent_pool.js new file mode 100644 index 00000000000..ed5464aa2cb --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.create_agent_pool.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, agentPool, agentPoolId) { + // [START storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_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 ID of the Google Cloud project that owns the + * agent pool. + */ + // const projectId = 'abc123' + /** + * Required. The agent pool to create. + */ + // const agentPool = {} + /** + * Required. The ID of the agent pool to create. + * The `agent_pool_id` must meet the following requirements: + * * Length of 128 characters or less. + * * Not start with the string `goog`. + * * Start with a lowercase ASCII character, followed by: + * * Zero or more: lowercase Latin alphabet characters, numerals, + * hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). + * * One or more numerals or lowercase ASCII characters. + * As expressed by the regular expression: + * `^(?!goog)a-z(a-z0-9-._~*a-z0-9)?$`. + */ + // const agentPoolId = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callCreateAgentPool() { + // Construct request + const request = { + projectId, + agentPool, + agentPoolId, + }; + + // Run request + const response = await storagetransferClient.createAgentPool(request); + console.log(response); + } + + callCreateAgentPool(); + // [END storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.create_transfer_job.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.create_transfer_job.js new file mode 100644 index 00000000000..5daf77621e2 --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.create_transfer_job.js @@ -0,0 +1,61 @@ +// 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(transferJob) { + // [START storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The job to create. + */ + // const transferJob = {} + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callCreateTransferJob() { + // Construct request + const request = { + transferJob, + }; + + // Run request + const response = await storagetransferClient.createTransferJob(request); + console.log(response); + } + + callCreateTransferJob(); + // [END storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.delete_agent_pool.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.delete_agent_pool.js new file mode 100644 index 00000000000..fe2d324e7e4 --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.delete_agent_pool.js @@ -0,0 +1,61 @@ +// 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 storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent pool to delete. + */ + // const name = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callDeleteAgentPool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storagetransferClient.deleteAgentPool(request); + console.log(response); + } + + callDeleteAgentPool(); + // [END storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.delete_transfer_job.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.delete_transfer_job.js new file mode 100644 index 00000000000..c70c25119cc --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.delete_transfer_job.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(jobName, projectId) { + // [START storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The job to delete. + */ + // const jobName = 'abc123' + /** + * Required. The ID of the Google Cloud project that owns the + * job. + */ + // const projectId = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callDeleteTransferJob() { + // Construct request + const request = { + jobName, + projectId, + }; + + // Run request + const response = await storagetransferClient.deleteTransferJob(request); + console.log(response); + } + + callDeleteTransferJob(); + // [END storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.get_agent_pool.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.get_agent_pool.js new file mode 100644 index 00000000000..4b30734fc60 --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.get_agent_pool.js @@ -0,0 +1,61 @@ +// 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 storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the agent pool to get. + */ + // const name = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callGetAgentPool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storagetransferClient.getAgentPool(request); + console.log(response); + } + + callGetAgentPool(); + // [END storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.get_google_service_account.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.get_google_service_account.js new file mode 100644 index 00000000000..1b8411e95ba --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.get_google_service_account.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId) { + // [START storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_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 ID of the Google Cloud project that the Google service + * account is associated with. + */ + // const projectId = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callGetGoogleServiceAccount() { + // Construct request + const request = { + projectId, + }; + + // Run request + const response = await storagetransferClient.getGoogleServiceAccount(request); + console.log(response); + } + + callGetGoogleServiceAccount(); + // [END storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.get_transfer_job.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.get_transfer_job.js new file mode 100644 index 00000000000..c7cbd13724e --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.get_transfer_job.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(jobName, projectId) { + // [START storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The job to get. + */ + // const jobName = 'abc123' + /** + * Required. The ID of the Google Cloud project that owns the + * job. + */ + // const projectId = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callGetTransferJob() { + // Construct request + const request = { + jobName, + projectId, + }; + + // Run request + const response = await storagetransferClient.getTransferJob(request); + console.log(response); + } + + callGetTransferJob(); + // [END storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.list_agent_pools.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.list_agent_pools.js new file mode 100644 index 00000000000..636a133ed8b --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.list_agent_pools.js @@ -0,0 +1,80 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId) { + // [START storagetransfer_v1_generated_StorageTransferService_ListAgentPools_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 ID of the Google Cloud project that owns the job. + */ + // const projectId = 'abc123' + /** + * An optional list of query parameters specified as JSON text in the + * form of: + * `{"agentPoolNames":"agentpool1","agentpool2",... }` + * Since `agentPoolNames` support multiple values, its values must be + * specified with array notation. When the filter is either empty or not + * provided, the list returns all agent pools for the project. + */ + // const filter = 'abc123' + /** + * The list page size. The max allowed value is `256`. + */ + // const pageSize = 1234 + /** + * The list page token. + */ + // const pageToken = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callListAgentPools() { + // Construct request + const request = { + projectId, + }; + + // Run request + const iterable = await storagetransferClient.listAgentPoolsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAgentPools(); + // [END storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.list_transfer_jobs.js new file mode 100644 index 00000000000..fa1d170f029 --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.list_transfer_jobs.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(filter) { + // [START storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_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. A list of query parameters specified as JSON text in the form of: + * `{"projectId":"my_project_id", + * "jobNames":"jobid1","jobid2",..., + * "jobStatuses":"status1","status2",... }` + * Since `jobNames` and `jobStatuses` support multiple values, their values + * must be specified with array notation. `projectId` is required. + * `jobNames` and `jobStatuses` are optional. The valid values for + * `jobStatuses` are case-insensitive: + * ENABLED google.storagetransfer.v1.TransferJob.Status.ENABLED, + * DISABLED google.storagetransfer.v1.TransferJob.Status.DISABLED, and + * DELETED google.storagetransfer.v1.TransferJob.Status.DELETED. + */ + // const filter = 'abc123' + /** + * The list page size. The max allowed value is 256. + */ + // const pageSize = 1234 + /** + * The list page token. + */ + // const pageToken = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callListTransferJobs() { + // Construct request + const request = { + filter, + }; + + // Run request + const iterable = await storagetransferClient.listTransferJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransferJobs(); + // [END storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js new file mode 100644 index 00000000000..9a11fd3d3fb --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.pause_transfer_operation.js @@ -0,0 +1,61 @@ +// 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 storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the transfer operation. + */ + // const name = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callPauseTransferOperation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storagetransferClient.pauseTransferOperation(request); + console.log(response); + } + + callPauseTransferOperation(); + // [END storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js new file mode 100644 index 00000000000..565ac8257cf --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.resume_transfer_operation.js @@ -0,0 +1,61 @@ +// 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 storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the transfer operation. + */ + // const name = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callResumeTransferOperation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storagetransferClient.resumeTransferOperation(request); + console.log(response); + } + + callResumeTransferOperation(); + // [END storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.run_transfer_job.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.run_transfer_job.js new file mode 100644 index 00000000000..ce83387cc2d --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.run_transfer_job.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(jobName, projectId) { + // [START storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the transfer job. + */ + // const jobName = 'abc123' + /** + * Required. The ID of the Google Cloud project that owns the transfer + * job. + */ + // const projectId = 'abc123' + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callRunTransferJob() { + // Construct request + const request = { + jobName, + projectId, + }; + + // Run request + const [operation] = await storagetransferClient.runTransferJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunTransferJob(); + // [END storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.update_agent_pool.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.update_agent_pool.js new file mode 100644 index 00000000000..b2cf8553295 --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.update_agent_pool.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(agentPool) { + // [START storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_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 agent pool to update. `agent_pool` is expected to specify following + * fields: + * * name google.storagetransfer.v1.AgentPool.name + * * display_name google.storagetransfer.v1.AgentPool.display_name + * * bandwidth_limit google.storagetransfer.v1.AgentPool.bandwidth_limit + * An `UpdateAgentPoolRequest` with any other fields is rejected + * with the error INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. + */ + // const agentPool = {} + /** + * The field mask + * (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) + * of the fields in `agentPool` to update in this request. + * The following `agentPool` fields can be updated: + * * display_name google.storagetransfer.v1.AgentPool.display_name + * * bandwidth_limit google.storagetransfer.v1.AgentPool.bandwidth_limit + */ + // const updateMask = {} + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callUpdateAgentPool() { + // Construct request + const request = { + agentPool, + }; + + // Run request + const response = await storagetransferClient.updateAgentPool(request); + console.log(response); + } + + callUpdateAgentPool(); + // [END storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.update_transfer_job.js b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.update_transfer_job.js new file mode 100644 index 00000000000..7961e988135 --- /dev/null +++ b/packages/google-storagetransfer/samples/generated/v1/storage_transfer_service.update_transfer_job.js @@ -0,0 +1,94 @@ +// 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(jobName, projectId, transferJob) { + // [START storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of job to update. + */ + // const jobName = 'abc123' + /** + * Required. The ID of the Google Cloud project that owns the + * job. + */ + // const projectId = 'abc123' + /** + * Required. The job to update. `transferJob` is expected to specify one or more of + * five fields: description google.storagetransfer.v1.TransferJob.description, + * transfer_spec google.storagetransfer.v1.TransferJob.transfer_spec, + * notification_config google.storagetransfer.v1.TransferJob.notification_config, + * logging_config google.storagetransfer.v1.TransferJob.logging_config, and + * status google.storagetransfer.v1.TransferJob.status. An `UpdateTransferJobRequest` that specifies + * other fields are rejected with the error + * INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. Updating a job status + * to DELETED google.storagetransfer.v1.TransferJob.Status.DELETED requires + * `storagetransfer.jobs.delete` permission. + */ + // const transferJob = {} + /** + * The field mask of the fields in `transferJob` that are to be updated in + * this request. Fields in `transferJob` that can be updated are: + * description google.storagetransfer.v1.TransferJob.description, + * transfer_spec google.storagetransfer.v1.TransferJob.transfer_spec, + * notification_config google.storagetransfer.v1.TransferJob.notification_config, + * logging_config google.storagetransfer.v1.TransferJob.logging_config, and + * status google.storagetransfer.v1.TransferJob.status. To update the `transfer_spec` of the job, a + * complete transfer specification must be provided. An incomplete + * specification missing any required fields is rejected with the error + * INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. + */ + // const updateTransferJobFieldMask = {} + + // Imports the Storagetransfer library + const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1; + + // Instantiates a client + const storagetransferClient = new StorageTransferServiceClient(); + + async function callUpdateTransferJob() { + // Construct request + const request = { + jobName, + projectId, + transferJob, + }; + + // Run request + const response = await storagetransferClient.updateTransferJob(request); + console.log(response); + } + + callUpdateTransferJob(); + // [END storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-storagetransfer/samples/package.json b/packages/google-storagetransfer/samples/package.json new file mode 100644 index 00000000000..47241a24b86 --- /dev/null +++ b/packages/google-storagetransfer/samples/package.json @@ -0,0 +1,26 @@ +{ + "name": "nodejs-storage-transfer", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha ---parallel --timeout 600000 test/*.test.js" + }, + "dependencies": { + "@google-cloud/storage-transfer": "^2.2.1" + }, + "devDependencies": { + "@google-cloud/storage": "^6.0.0", + "aws-sdk": "^2.1073.0", + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^9.0.0", + "uuid": "^9.0.0" + } +} diff --git a/packages/google-storagetransfer/samples/quickstart.js b/packages/google-storagetransfer/samples/quickstart.js new file mode 100644 index 00000000000..f8d689408a8 --- /dev/null +++ b/packages/google-storagetransfer/samples/quickstart.js @@ -0,0 +1,79 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +'use strict'; + +async function main(projectId = 'my-project', gcsSourceBucket, gcsSinkBucket) { + // [START storagetransfer_quickstart] + + // Imports the Google Cloud client library + const { + StorageTransferServiceClient, + } = require('@google-cloud/storage-transfer'); + + /** + * TODO(developer): Uncomment the following lines before running the sample. + */ + // Your project id + // const projectId = 'my-project' + + // The ID of the GCS bucket to transfer data from + // const gcsSourceBucket = 'my-source-bucket' + + // The ID of the GCS bucket to transfer data to + // const gcsSinkBucket = 'my-sink-bucket' + + // Creates a client + const client = new StorageTransferServiceClient(); + + /** + * Creates a one-time transfer job. + */ + async function quickstart() { + // Creates a request to transfer from the source bucket to + // the sink bucket + const createRequest = { + transferJob: { + projectId: projectId, + transferSpec: { + gcsDataSource: {bucketName: gcsSourceBucket}, + gcsDataSink: {bucketName: gcsSinkBucket}, + }, + status: 'ENABLED', + }, + }; + + // Runs the request and creates the job + const [transferJob] = await client.createTransferJob(createRequest); + + const runRequest = { + jobName: transferJob.name, + projectId: projectId, + }; + await client.runTransferJob(runRequest); + + console.log( + `Created and ran a transfer job from ${gcsSourceBucket} to ${gcsSinkBucket} with name ${transferJob.name}` + ); + } + + quickstart(); + // [END storagetransfer_quickstart] +} + +main(...process.argv.slice(2)); + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-storagetransfer/samples/test/quickstart.test.js b/packages/google-storagetransfer/samples/test/quickstart.test.js new file mode 100644 index 00000000000..9c8a5a1b277 --- /dev/null +++ b/packages/google-storagetransfer/samples/test/quickstart.test.js @@ -0,0 +1,59 @@ +// 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. +// +// ** 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'; + +const {assert} = require('chai'); +const {after, before, describe, it} = require('mocha'); + +const {BucketManager, TransferJobManager, runSample} = require('./utils'); + +describe('quickstart', () => { + const testBucketManager = new BucketManager(); + const testTransferJobManager = new TransferJobManager(); + + let projectId; + let sourceBucket; + let sinkBucket; + + before(async () => { + projectId = await testBucketManager.getProjectId(); + sourceBucket = (await testBucketManager.generateGCSBucket()).name; + sinkBucket = (await testBucketManager.generateGCSBucket()).name; + }); + + after(async () => { + await testBucketManager.deleteBuckets(); + await testTransferJobManager.cleanUp(); + }); + + it('should run quickstart', async () => { + const output = await runSample('quickstart', [ + projectId, + sourceBucket, + sinkBucket, + ]); + + assert.include(output, 'transferJobs/'); + + // If it ran successfully and a job was created, delete it to clean up + const [jobName] = output.match(/transferJobs.*/); + + testTransferJobManager.transferJobToCleanUp(jobName); + }); +}); diff --git a/packages/google-storagetransfer/src/index.ts b/packages/google-storagetransfer/src/index.ts new file mode 100644 index 00000000000..66c8a668b50 --- /dev/null +++ b/packages/google-storagetransfer/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const StorageTransferServiceClient = v1.StorageTransferServiceClient; +type StorageTransferServiceClient = v1.StorageTransferServiceClient; + +export {v1, StorageTransferServiceClient}; +export default {v1, StorageTransferServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-storagetransfer/src/v1/gapic_metadata.json b/packages/google-storagetransfer/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..4155aeb813c --- /dev/null +++ b/packages/google-storagetransfer/src/v1/gapic_metadata.json @@ -0,0 +1,171 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.storagetransfer.v1", + "libraryPackage": "@google-cloud/storage-transfer", + "services": { + "StorageTransferService": { + "clients": { + "grpc": { + "libraryClient": "StorageTransferServiceClient", + "rpcs": { + "GetGoogleServiceAccount": { + "methods": [ + "getGoogleServiceAccount" + ] + }, + "CreateTransferJob": { + "methods": [ + "createTransferJob" + ] + }, + "UpdateTransferJob": { + "methods": [ + "updateTransferJob" + ] + }, + "GetTransferJob": { + "methods": [ + "getTransferJob" + ] + }, + "PauseTransferOperation": { + "methods": [ + "pauseTransferOperation" + ] + }, + "ResumeTransferOperation": { + "methods": [ + "resumeTransferOperation" + ] + }, + "DeleteTransferJob": { + "methods": [ + "deleteTransferJob" + ] + }, + "CreateAgentPool": { + "methods": [ + "createAgentPool" + ] + }, + "UpdateAgentPool": { + "methods": [ + "updateAgentPool" + ] + }, + "GetAgentPool": { + "methods": [ + "getAgentPool" + ] + }, + "DeleteAgentPool": { + "methods": [ + "deleteAgentPool" + ] + }, + "RunTransferJob": { + "methods": [ + "runTransferJob" + ] + }, + "ListTransferJobs": { + "methods": [ + "listTransferJobs", + "listTransferJobsStream", + "listTransferJobsAsync" + ] + }, + "ListAgentPools": { + "methods": [ + "listAgentPools", + "listAgentPoolsStream", + "listAgentPoolsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "StorageTransferServiceClient", + "rpcs": { + "GetGoogleServiceAccount": { + "methods": [ + "getGoogleServiceAccount" + ] + }, + "CreateTransferJob": { + "methods": [ + "createTransferJob" + ] + }, + "UpdateTransferJob": { + "methods": [ + "updateTransferJob" + ] + }, + "GetTransferJob": { + "methods": [ + "getTransferJob" + ] + }, + "PauseTransferOperation": { + "methods": [ + "pauseTransferOperation" + ] + }, + "ResumeTransferOperation": { + "methods": [ + "resumeTransferOperation" + ] + }, + "DeleteTransferJob": { + "methods": [ + "deleteTransferJob" + ] + }, + "CreateAgentPool": { + "methods": [ + "createAgentPool" + ] + }, + "UpdateAgentPool": { + "methods": [ + "updateAgentPool" + ] + }, + "GetAgentPool": { + "methods": [ + "getAgentPool" + ] + }, + "DeleteAgentPool": { + "methods": [ + "deleteAgentPool" + ] + }, + "RunTransferJob": { + "methods": [ + "runTransferJob" + ] + }, + "ListTransferJobs": { + "methods": [ + "listTransferJobs", + "listTransferJobsStream", + "listTransferJobsAsync" + ] + }, + "ListAgentPools": { + "methods": [ + "listAgentPools", + "listAgentPoolsStream", + "listAgentPoolsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-storagetransfer/src/v1/index.ts b/packages/google-storagetransfer/src/v1/index.ts new file mode 100644 index 00000000000..f0a69d47c55 --- /dev/null +++ b/packages/google-storagetransfer/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 {StorageTransferServiceClient} from './storage_transfer_service_client'; diff --git a/packages/google-storagetransfer/src/v1/storage_transfer_service_client.ts b/packages/google-storagetransfer/src/v1/storage_transfer_service_client.ts new file mode 100644 index 00000000000..4e4560bcbff --- /dev/null +++ b/packages/google-storagetransfer/src/v1/storage_transfer_service_client.ts @@ -0,0 +1,2308 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/storage_transfer_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './storage_transfer_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Storage Transfer Service and its protos. + * Transfers data between between Google Cloud Storage buckets or from a data + * source external to Google to a Cloud Storage bucket. + * @class + * @memberof v1 + */ +export class StorageTransferServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + storageTransferServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of StorageTransferServiceClient. + * + * @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 StorageTransferServiceClient({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 StorageTransferServiceClient; + 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 = { + agentPoolsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project_id}/agentPools/{agent_pool_id}' + ), + }; + + // 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 = { + listTransferJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'transferJobs' + ), + listAgentPools: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'agentPools' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=transferOperations/**}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=transferOperations/**}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=transferOperations}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const runTransferJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const runTransferJobMetadata = protoFilesRoot.lookup( + '.google.storagetransfer.v1.TransferOperation' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + runTransferJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runTransferJobResponse.decode.bind(runTransferJobResponse), + runTransferJobMetadata.decode.bind(runTransferJobMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.storagetransfer.v1.StorageTransferService', + 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.storageTransferServiceStub) { + return this.storageTransferServiceStub; + } + + // Put together the "service stub" for + // google.storagetransfer.v1.StorageTransferService. + this.storageTransferServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.storagetransfer.v1.StorageTransferService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.storagetransfer.v1 + .StorageTransferService, + 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 storageTransferServiceStubMethods = [ + 'getGoogleServiceAccount', + 'createTransferJob', + 'updateTransferJob', + 'getTransferJob', + 'listTransferJobs', + 'pauseTransferOperation', + 'resumeTransferOperation', + 'runTransferJob', + 'deleteTransferJob', + 'createAgentPool', + 'updateAgentPool', + 'getAgentPool', + 'listAgentPools', + 'deleteAgentPool', + ]; + for (const methodName of storageTransferServiceStubMethods) { + const callPromise = this.storageTransferServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.storageTransferServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'storagetransfer.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 'storagetransfer.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Returns the Google service account that is used by Storage Transfer + * Service to access buckets in the project where transfers + * run or in other projects. Each Google service account is associated + * with one Google Cloud project. Users + * should add this service account to the Google Cloud Storage bucket + * ACLs to grant access to Storage Transfer Service. This service + * account is created and owned by Storage Transfer Service and can + * only be used by Storage Transfer Service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that the Google service + * account is associated with. + * @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 [GoogleServiceAccount]{@link google.storagetransfer.v1.GoogleServiceAccount}. + * 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/storage_transfer_service.get_google_service_account.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_async + */ + getGoogleServiceAccount( + request?: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.IGoogleServiceAccount, + ( + | protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest + | undefined + ), + {} | undefined + ] + >; + getGoogleServiceAccount( + request: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.IGoogleServiceAccount, + | protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGoogleServiceAccount( + request: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, + callback: Callback< + protos.google.storagetransfer.v1.IGoogleServiceAccount, + | protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGoogleServiceAccount( + request?: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.storagetransfer.v1.IGoogleServiceAccount, + | protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.storagetransfer.v1.IGoogleServiceAccount, + | protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.storagetransfer.v1.IGoogleServiceAccount, + ( + | protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getGoogleServiceAccount( + request, + options, + callback + ); + } + /** + * Creates a transfer job that runs periodically. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.storagetransfer.v1.TransferJob} request.transferJob + * Required. The job to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TransferJob]{@link google.storagetransfer.v1.TransferJob}. + * 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/storage_transfer_service.create_transfer_job.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_async + */ + createTransferJob( + request?: protos.google.storagetransfer.v1.ICreateTransferJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.ICreateTransferJobRequest | undefined, + {} | undefined + ] + >; + createTransferJob( + request: protos.google.storagetransfer.v1.ICreateTransferJobRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.ICreateTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createTransferJob( + request: protos.google.storagetransfer.v1.ICreateTransferJobRequest, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.ICreateTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createTransferJob( + request?: protos.google.storagetransfer.v1.ICreateTransferJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.ICreateTransferJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.ICreateTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.ICreateTransferJobRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.createTransferJob(request, options, callback); + } + /** + * Updates a transfer job. Updating a job's transfer spec does not affect + * transfer operations that are running already. + * + * **Note:** The job's {@link google.storagetransfer.v1.TransferJob.status|status} field can be modified + * using this RPC (for example, to set a job's status to + * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}, + * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, or + * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.jobName + * Required. The name of job to update. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the + * job. + * @param {google.storagetransfer.v1.TransferJob} request.transferJob + * Required. The job to update. `transferJob` is expected to specify one or more of + * five fields: {@link google.storagetransfer.v1.TransferJob.description|description}, + * {@link google.storagetransfer.v1.TransferJob.transfer_spec|transfer_spec}, + * {@link google.storagetransfer.v1.TransferJob.notification_config|notification_config}, + * {@link google.storagetransfer.v1.TransferJob.logging_config|logging_config}, and + * {@link google.storagetransfer.v1.TransferJob.status|status}. An `UpdateTransferJobRequest` that specifies + * other fields are rejected with the error + * {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. Updating a job status + * to {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED} requires + * `storagetransfer.jobs.delete` permission. + * @param {google.protobuf.FieldMask} request.updateTransferJobFieldMask + * The field mask of the fields in `transferJob` that are to be updated in + * this request. Fields in `transferJob` that can be updated are: + * {@link google.storagetransfer.v1.TransferJob.description|description}, + * {@link google.storagetransfer.v1.TransferJob.transfer_spec|transfer_spec}, + * {@link google.storagetransfer.v1.TransferJob.notification_config|notification_config}, + * {@link google.storagetransfer.v1.TransferJob.logging_config|logging_config}, and + * {@link google.storagetransfer.v1.TransferJob.status|status}. To update the `transfer_spec` of the job, a + * complete transfer specification must be provided. An incomplete + * specification missing any required fields is rejected with the error + * {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. + * @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 [TransferJob]{@link google.storagetransfer.v1.TransferJob}. + * 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/storage_transfer_service.update_transfer_job.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_async + */ + updateTransferJob( + request?: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IUpdateTransferJobRequest | undefined, + {} | undefined + ] + >; + updateTransferJob( + request: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.IUpdateTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTransferJob( + request: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.IUpdateTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTransferJob( + request?: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.IUpdateTransferJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.IUpdateTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IUpdateTransferJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + job_name: request.jobName ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTransferJob(request, options, callback); + } + /** + * Gets a transfer job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.jobName + * Required. The job to get. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the + * job. + * @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 [TransferJob]{@link google.storagetransfer.v1.TransferJob}. + * 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/storage_transfer_service.get_transfer_job.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_GetTransferJob_async + */ + getTransferJob( + request?: protos.google.storagetransfer.v1.IGetTransferJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IGetTransferJobRequest | undefined, + {} | undefined + ] + >; + getTransferJob( + request: protos.google.storagetransfer.v1.IGetTransferJobRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.IGetTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTransferJob( + request: protos.google.storagetransfer.v1.IGetTransferJobRequest, + callback: Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.IGetTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTransferJob( + request?: protos.google.storagetransfer.v1.IGetTransferJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.IGetTransferJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.storagetransfer.v1.ITransferJob, + | protos.google.storagetransfer.v1.IGetTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.storagetransfer.v1.ITransferJob, + protos.google.storagetransfer.v1.IGetTransferJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + job_name: request.jobName ?? '', + }); + this.initialize(); + return this.innerApiCalls.getTransferJob(request, options, callback); + } + /** + * Pauses a transfer operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the transfer operation. + * @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/storage_transfer_service.pause_transfer_operation.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_async + */ + pauseTransferOperation( + request?: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.storagetransfer.v1.IPauseTransferOperationRequest + | undefined + ), + {} | undefined + ] + >; + pauseTransferOperation( + request: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IPauseTransferOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + pauseTransferOperation( + request: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IPauseTransferOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + pauseTransferOperation( + request?: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IPauseTransferOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IPauseTransferOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.storagetransfer.v1.IPauseTransferOperationRequest + | 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.pauseTransferOperation( + request, + options, + callback + ); + } + /** + * Resumes a transfer operation that is paused. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the transfer operation. + * @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/storage_transfer_service.resume_transfer_operation.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_async + */ + resumeTransferOperation( + request?: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.storagetransfer.v1.IResumeTransferOperationRequest + | undefined + ), + {} | undefined + ] + >; + resumeTransferOperation( + request: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IResumeTransferOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + resumeTransferOperation( + request: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IResumeTransferOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + resumeTransferOperation( + request?: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IResumeTransferOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IResumeTransferOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.storagetransfer.v1.IResumeTransferOperationRequest + | 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.resumeTransferOperation( + request, + options, + callback + ); + } + /** + * Deletes a transfer job. Deleting a transfer job sets its status to + * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.jobName + * Required. The job to delete. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the + * job. + * @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/storage_transfer_service.delete_transfer_job.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_async + */ + deleteTransferJob( + request?: protos.google.storagetransfer.v1.IDeleteTransferJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteTransferJobRequest | undefined, + {} | undefined + ] + >; + deleteTransferJob( + request: protos.google.storagetransfer.v1.IDeleteTransferJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTransferJob( + request: protos.google.storagetransfer.v1.IDeleteTransferJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTransferJob( + request?: protos.google.storagetransfer.v1.IDeleteTransferJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteTransferJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteTransferJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteTransferJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + job_name: request.jobName ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteTransferJob(request, options, callback); + } + /** + * Creates an agent pool resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the + * agent pool. + * @param {google.storagetransfer.v1.AgentPool} request.agentPool + * Required. The agent pool to create. + * @param {string} request.agentPoolId + * Required. The ID of the agent pool to create. + * + * The `agent_pool_id` must meet the following requirements: + * + * * Length of 128 characters or less. + * * Not start with the string `goog`. + * * Start with a lowercase ASCII character, followed by: + * * Zero or more: lowercase Latin alphabet characters, numerals, + * hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). + * * One or more numerals or lowercase ASCII characters. + * + * As expressed by the regular expression: + * `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`. + * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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/storage_transfer_service.create_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_async + */ + createAgentPool( + request?: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.ICreateAgentPoolRequest | undefined, + {} | undefined + ] + >; + createAgentPool( + request: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.ICreateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAgentPool( + request: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.ICreateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAgentPool( + request?: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.ICreateAgentPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.ICreateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.ICreateAgentPoolRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + }); + this.initialize(); + return this.innerApiCalls.createAgentPool(request, options, callback); + } + /** + * Updates an existing agent pool resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.storagetransfer.v1.AgentPool} request.agentPool + * Required. The agent pool to update. `agent_pool` is expected to specify following + * fields: + * + * * {@link google.storagetransfer.v1.AgentPool.name|name} + * + * * {@link google.storagetransfer.v1.AgentPool.display_name|display_name} + * + * * {@link google.storagetransfer.v1.AgentPool.bandwidth_limit|bandwidth_limit} + * An `UpdateAgentPoolRequest` with any other fields is rejected + * with the error {@link google.rpc.Code.INVALID_ARGUMENT|INVALID_ARGUMENT}. + * @param {google.protobuf.FieldMask} request.updateMask + * The [field mask] + * (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) + * of the fields in `agentPool` to update in this request. + * The following `agentPool` fields can be updated: + * + * * {@link google.storagetransfer.v1.AgentPool.display_name|display_name} + * + * * {@link google.storagetransfer.v1.AgentPool.bandwidth_limit|bandwidth_limit} + * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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/storage_transfer_service.update_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_async + */ + updateAgentPool( + request?: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IUpdateAgentPoolRequest | undefined, + {} | undefined + ] + >; + updateAgentPool( + request: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.IUpdateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAgentPool( + request: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.IUpdateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAgentPool( + request?: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.IUpdateAgentPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.IUpdateAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IUpdateAgentPoolRequest | 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({ + 'agent_pool.name': request.agentPool!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAgentPool(request, options, callback); + } + /** + * Gets an agent pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent pool to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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/storage_transfer_service.get_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_GetAgentPool_async + */ + getAgentPool( + request?: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest | undefined, + {} | undefined + ] + >; + getAgentPool( + request: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest | null | undefined, + {} | null | undefined + > + ): void; + getAgentPool( + request: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + callback: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest | null | undefined, + {} | null | undefined + > + ): void; + getAgentPool( + request?: protos.google.storagetransfer.v1.IGetAgentPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.storagetransfer.v1.IAgentPool, + | protos.google.storagetransfer.v1.IGetAgentPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool, + protos.google.storagetransfer.v1.IGetAgentPoolRequest | 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.getAgentPool(request, options, callback); + } + /** + * Deletes an agent pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the agent pool to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/storage_transfer_service.delete_agent_pool.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_async + */ + deleteAgentPool( + request?: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteAgentPoolRequest | undefined, + {} | undefined + ] + >; + deleteAgentPool( + request: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAgentPool( + request: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAgentPool( + request?: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteAgentPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.storagetransfer.v1.IDeleteAgentPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.IDeleteAgentPoolRequest | 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.deleteAgentPool(request, options, callback); + } + + /** + * Attempts to start a new TransferOperation for the current TransferJob. A + * TransferJob has a maximum of one active TransferOperation. If this method + * is called while a TransferOperation is active, an error will be returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.jobName + * Required. The name of the transfer job. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the transfer + * job. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/storage_transfer_service.run_transfer_job.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async + */ + runTransferJob( + request?: protos.google.storagetransfer.v1.IRunTransferJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.ITransferOperation + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + runTransferJob( + request: protos.google.storagetransfer.v1.IRunTransferJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.ITransferOperation + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runTransferJob( + request: protos.google.storagetransfer.v1.IRunTransferJobRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.ITransferOperation + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runTransferJob( + request?: protos.google.storagetransfer.v1.IRunTransferJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.ITransferOperation + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.ITransferOperation + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.ITransferOperation + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + job_name: request.jobName ?? '', + }); + this.initialize(); + return this.innerApiCalls.runTransferJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `runTransferJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/storage_transfer_service.run_transfer_job.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_RunTransferJob_async + */ + async checkRunTransferJobProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.storagetransfer.v1.TransferOperation + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.runTransferJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.storagetransfer.v1.TransferOperation + >; + } + /** + * Lists transfer jobs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * Required. A list of query parameters specified as JSON text in the form of: + * `{"projectId":"my_project_id", + * "jobNames":["jobid1","jobid2",...], + * "jobStatuses":["status1","status2",...]}` + * + * Since `jobNames` and `jobStatuses` support multiple values, their values + * must be specified with array notation. `projectId` is required. + * `jobNames` and `jobStatuses` are optional. The valid values for + * `jobStatuses` are case-insensitive: + * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}, + * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, and + * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}. + * @param {number} request.pageSize + * The list page size. The max allowed value is 256. + * @param {string} request.pageToken + * The list page token. + * @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 [TransferJob]{@link google.storagetransfer.v1.TransferJob}. + * 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 `listTransferJobsAsync()` + * 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. + */ + listTransferJobs( + request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.ITransferJob[], + protos.google.storagetransfer.v1.IListTransferJobsRequest | null, + protos.google.storagetransfer.v1.IListTransferJobsResponse + ] + >; + listTransferJobs( + request: protos.google.storagetransfer.v1.IListTransferJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.storagetransfer.v1.IListTransferJobsRequest, + | protos.google.storagetransfer.v1.IListTransferJobsResponse + | null + | undefined, + protos.google.storagetransfer.v1.ITransferJob + > + ): void; + listTransferJobs( + request: protos.google.storagetransfer.v1.IListTransferJobsRequest, + callback: PaginationCallback< + protos.google.storagetransfer.v1.IListTransferJobsRequest, + | protos.google.storagetransfer.v1.IListTransferJobsResponse + | null + | undefined, + protos.google.storagetransfer.v1.ITransferJob + > + ): void; + listTransferJobs( + request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.storagetransfer.v1.IListTransferJobsRequest, + | protos.google.storagetransfer.v1.IListTransferJobsResponse + | null + | undefined, + protos.google.storagetransfer.v1.ITransferJob + >, + callback?: PaginationCallback< + protos.google.storagetransfer.v1.IListTransferJobsRequest, + | protos.google.storagetransfer.v1.IListTransferJobsResponse + | null + | undefined, + protos.google.storagetransfer.v1.ITransferJob + > + ): Promise< + [ + protos.google.storagetransfer.v1.ITransferJob[], + protos.google.storagetransfer.v1.IListTransferJobsRequest | null, + protos.google.storagetransfer.v1.IListTransferJobsResponse + ] + > | 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 || {}; + this.initialize(); + return this.innerApiCalls.listTransferJobs(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.filter + * Required. A list of query parameters specified as JSON text in the form of: + * `{"projectId":"my_project_id", + * "jobNames":["jobid1","jobid2",...], + * "jobStatuses":["status1","status2",...]}` + * + * Since `jobNames` and `jobStatuses` support multiple values, their values + * must be specified with array notation. `projectId` is required. + * `jobNames` and `jobStatuses` are optional. The valid values for + * `jobStatuses` are case-insensitive: + * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}, + * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, and + * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}. + * @param {number} request.pageSize + * The list page size. The max allowed value is 256. + * @param {string} request.pageToken + * The list page token. + * @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 [TransferJob]{@link google.storagetransfer.v1.TransferJob} 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 `listTransferJobsAsync()` + * 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. + */ + listTransferJobsStream( + request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTransferJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferJobs.createStream( + this.innerApiCalls.listTransferJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTransferJobs`, 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.filter + * Required. A list of query parameters specified as JSON text in the form of: + * `{"projectId":"my_project_id", + * "jobNames":["jobid1","jobid2",...], + * "jobStatuses":["status1","status2",...]}` + * + * Since `jobNames` and `jobStatuses` support multiple values, their values + * must be specified with array notation. `projectId` is required. + * `jobNames` and `jobStatuses` are optional. The valid values for + * `jobStatuses` are case-insensitive: + * {@link google.storagetransfer.v1.TransferJob.Status.ENABLED|ENABLED}, + * {@link google.storagetransfer.v1.TransferJob.Status.DISABLED|DISABLED}, and + * {@link google.storagetransfer.v1.TransferJob.Status.DELETED|DELETED}. + * @param {number} request.pageSize + * The list page size. The max allowed value is 256. + * @param {string} request.pageToken + * The list page token. + * @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 + * [TransferJob]{@link google.storagetransfer.v1.TransferJob}. 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/storage_transfer_service.list_transfer_jobs.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_async + */ + listTransferJobsAsync( + request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTransferJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferJobs.asyncIterate( + this.innerApiCalls['listTransferJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists agent pools. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud project that owns the job. + * @param {string} request.filter + * An optional list of query parameters specified as JSON text in the + * form of: + * + * `{"agentPoolNames":["agentpool1","agentpool2",...]}` + * + * Since `agentPoolNames` support multiple values, its values must be + * specified with array notation. When the filter is either empty or not + * provided, the list returns all agent pools for the project. + * @param {number} request.pageSize + * The list page size. The max allowed value is `256`. + * @param {string} request.pageToken + * The list page token. + * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool}. + * 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 `listAgentPoolsAsync()` + * 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. + */ + listAgentPools( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool[], + protos.google.storagetransfer.v1.IListAgentPoolsRequest | null, + protos.google.storagetransfer.v1.IListAgentPoolsResponse + ] + >; + listAgentPools( + request: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + | protos.google.storagetransfer.v1.IListAgentPoolsResponse + | null + | undefined, + protos.google.storagetransfer.v1.IAgentPool + > + ): void; + listAgentPools( + request: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + callback: PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + | protos.google.storagetransfer.v1.IListAgentPoolsResponse + | null + | undefined, + protos.google.storagetransfer.v1.IAgentPool + > + ): void; + listAgentPools( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + | protos.google.storagetransfer.v1.IListAgentPoolsResponse + | null + | undefined, + protos.google.storagetransfer.v1.IAgentPool + >, + callback?: PaginationCallback< + protos.google.storagetransfer.v1.IListAgentPoolsRequest, + | protos.google.storagetransfer.v1.IListAgentPoolsResponse + | null + | undefined, + protos.google.storagetransfer.v1.IAgentPool + > + ): Promise< + [ + protos.google.storagetransfer.v1.IAgentPool[], + protos.google.storagetransfer.v1.IListAgentPoolsRequest | null, + protos.google.storagetransfer.v1.IListAgentPoolsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + }); + this.initialize(); + return this.innerApiCalls.listAgentPools(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.projectId + * Required. The ID of the Google Cloud project that owns the job. + * @param {string} request.filter + * An optional list of query parameters specified as JSON text in the + * form of: + * + * `{"agentPoolNames":["agentpool1","agentpool2",...]}` + * + * Since `agentPoolNames` support multiple values, its values must be + * specified with array notation. When the filter is either empty or not + * provided, the list returns all agent pools for the project. + * @param {number} request.pageSize + * The list page size. The max allowed value is `256`. + * @param {string} request.pageToken + * The list page token. + * @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 [AgentPool]{@link google.storagetransfer.v1.AgentPool} 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 `listAgentPoolsAsync()` + * 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. + */ + listAgentPoolsStream( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + }); + const defaultCallSettings = this._defaults['listAgentPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAgentPools.createStream( + this.innerApiCalls.listAgentPools as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAgentPools`, 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.projectId + * Required. The ID of the Google Cloud project that owns the job. + * @param {string} request.filter + * An optional list of query parameters specified as JSON text in the + * form of: + * + * `{"agentPoolNames":["agentpool1","agentpool2",...]}` + * + * Since `agentPoolNames` support multiple values, its values must be + * specified with array notation. When the filter is either empty or not + * provided, the list returns all agent pools for the project. + * @param {number} request.pageSize + * The list page size. The max allowed value is `256`. + * @param {string} request.pageToken + * The list page token. + * @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 + * [AgentPool]{@link google.storagetransfer.v1.AgentPool}. 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/storage_transfer_service.list_agent_pools.js + * region_tag:storagetransfer_v1_generated_StorageTransferService_ListAgentPools_async + */ + listAgentPoolsAsync( + request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + }); + const defaultCallSettings = this._defaults['listAgentPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAgentPools.asyncIterate( + this.innerApiCalls['listAgentPools'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agentPools resource name string. + * + * @param {string} project_id + * @param {string} agent_pool_id + * @returns {string} Resource name string. + */ + agentPoolsPath(projectId: string, agentPoolId: string) { + return this.pathTemplates.agentPoolsPathTemplate.render({ + project_id: projectId, + agent_pool_id: agentPoolId, + }); + } + + /** + * Parse the project_id from AgentPools resource. + * + * @param {string} agentPoolsName + * A fully-qualified path representing agentPools resource. + * @returns {string} A string representing the project_id. + */ + matchProjectIdFromAgentPoolsName(agentPoolsName: string) { + return this.pathTemplates.agentPoolsPathTemplate.match(agentPoolsName) + .project_id; + } + + /** + * Parse the agent_pool_id from AgentPools resource. + * + * @param {string} agentPoolsName + * A fully-qualified path representing agentPools resource. + * @returns {string} A string representing the agent_pool_id. + */ + matchAgentPoolIdFromAgentPoolsName(agentPoolsName: string) { + return this.pathTemplates.agentPoolsPathTemplate.match(agentPoolsName) + .agent_pool_id; + } + + /** + * 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.storageTransferServiceStub && !this._terminated) { + return this.storageTransferServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-storagetransfer/src/v1/storage_transfer_service_client_config.json b/packages/google-storagetransfer/src/v1/storage_transfer_service_client_config.json new file mode 100644 index 00000000000..93b45375803 --- /dev/null +++ b/packages/google-storagetransfer/src/v1/storage_transfer_service_client_config.json @@ -0,0 +1,108 @@ +{ + "interfaces": { + "google.storagetransfer.v1.StorageTransferService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "264268458a9e88347dbacbd9398202ff5885a40b": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetGoogleServiceAccount": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "CreateTransferJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTransferJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "GetTransferJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ListTransferJobs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "PauseTransferOperation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ResumeTransferOperation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "RunTransferJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "DeleteTransferJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "CreateAgentPool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "UpdateAgentPool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "GetAgentPool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "ListAgentPools": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + }, + "DeleteAgentPool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + } + } + } + } +} diff --git a/packages/google-storagetransfer/src/v1/storage_transfer_service_proto_list.json b/packages/google-storagetransfer/src/v1/storage_transfer_service_proto_list.json new file mode 100644 index 00000000000..ea755b43ae3 --- /dev/null +++ b/packages/google-storagetransfer/src/v1/storage_transfer_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/storagetransfer/v1/transfer.proto", + "../../protos/google/storagetransfer/v1/transfer_types.proto" +] diff --git a/packages/google-storagetransfer/system-test/fixtures/sample/src/index.js b/packages/google-storagetransfer/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..7242786874f --- /dev/null +++ b/packages/google-storagetransfer/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 storagetransfer = require('@google-cloud/storage-transfer'); + +function main() { + const storageTransferServiceClient = + new storagetransfer.StorageTransferServiceClient(); +} + +main(); diff --git a/packages/google-storagetransfer/system-test/fixtures/sample/src/index.ts b/packages/google-storagetransfer/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..26a57298196 --- /dev/null +++ b/packages/google-storagetransfer/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 {StorageTransferServiceClient} from '@google-cloud/storage-transfer'; + +// check that the client class type name can be used +function doStuffWithStorageTransferServiceClient( + client: StorageTransferServiceClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const storageTransferServiceClient = new StorageTransferServiceClient(); + doStuffWithStorageTransferServiceClient(storageTransferServiceClient); +} + +main(); diff --git a/packages/google-storagetransfer/system-test/install.ts b/packages/google-storagetransfer/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-storagetransfer/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-storagetransfer/test/gapic_storage_transfer_service_v1.ts b/packages/google-storagetransfer/test/gapic_storage_transfer_service_v1.ts new file mode 100644 index 00000000000..e37c67fd45e --- /dev/null +++ b/packages/google-storagetransfer/test/gapic_storage_transfer_service_v1.ts @@ -0,0 +1,2840 @@ +// 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 storagetransferserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.StorageTransferServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + storagetransferserviceModule.v1.StorageTransferServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + storagetransferserviceModule.v1.StorageTransferServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + storagetransferserviceModule.v1.StorageTransferServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.storageTransferServiceStub, undefined); + await client.initialize(); + assert(client.storageTransferServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.storageTransferServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.storageTransferServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + 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 storagetransferserviceModule.v1.StorageTransferServiceClient({ + 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('getGoogleServiceAccount', () => { + it('invokes getGoogleServiceAccount without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetGoogleServiceAccountRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.GoogleServiceAccount() + ); + client.innerApiCalls.getGoogleServiceAccount = + stubSimpleCall(expectedResponse); + const [response] = await client.getGoogleServiceAccount(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGoogleServiceAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGoogleServiceAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGoogleServiceAccount without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetGoogleServiceAccountRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.GoogleServiceAccount() + ); + client.innerApiCalls.getGoogleServiceAccount = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGoogleServiceAccount( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.IGoogleServiceAccount | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGoogleServiceAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGoogleServiceAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGoogleServiceAccount with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetGoogleServiceAccountRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGoogleServiceAccount = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getGoogleServiceAccount(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getGoogleServiceAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGoogleServiceAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGoogleServiceAccount with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetGoogleServiceAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetGoogleServiceAccountRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getGoogleServiceAccount(request), + expectedError + ); + }); + }); + + describe('createTransferJob', () => { + it('invokes createTransferJob without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateTransferJobRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ); + client.innerApiCalls.createTransferJob = stubSimpleCall(expectedResponse); + const [response] = await client.createTransferJob(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTransferJob without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateTransferJobRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ); + client.innerApiCalls.createTransferJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTransferJob( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.ITransferJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTransferJob with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateTransferJobRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createTransferJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createTransferJob(request), expectedError); + }); + + it('invokes createTransferJob with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateTransferJobRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTransferJob(request), expectedError); + }); + }); + + describe('updateTransferJob', () => { + it('invokes updateTransferJob without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.UpdateTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ); + client.innerApiCalls.updateTransferJob = stubSimpleCall(expectedResponse); + const [response] = await client.updateTransferJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransferJob without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.UpdateTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ); + client.innerApiCalls.updateTransferJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTransferJob( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.ITransferJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransferJob with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.UpdateTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTransferJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTransferJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransferJob with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.UpdateTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTransferJob(request), expectedError); + }); + }); + + describe('getTransferJob', () => { + it('invokes getTransferJob without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ); + client.innerApiCalls.getTransferJob = stubSimpleCall(expectedResponse); + const [response] = await client.getTransferJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferJob without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ); + client.innerApiCalls.getTransferJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTransferJob( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.ITransferJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferJob with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTransferJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTransferJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferJob with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTransferJob(request), expectedError); + }); + }); + + describe('pauseTransferOperation', () => { + it('invokes pauseTransferOperation without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.PauseTransferOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.PauseTransferOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.pauseTransferOperation = + stubSimpleCall(expectedResponse); + const [response] = await client.pauseTransferOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pauseTransferOperation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseTransferOperation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseTransferOperation without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.PauseTransferOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.PauseTransferOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.pauseTransferOperation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pauseTransferOperation( + 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.pauseTransferOperation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseTransferOperation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseTransferOperation with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.PauseTransferOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.PauseTransferOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseTransferOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.pauseTransferOperation(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.pauseTransferOperation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseTransferOperation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseTransferOperation with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.PauseTransferOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.PauseTransferOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.pauseTransferOperation(request), + expectedError + ); + }); + }); + + describe('resumeTransferOperation', () => { + it('invokes resumeTransferOperation without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ResumeTransferOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.ResumeTransferOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.resumeTransferOperation = + stubSimpleCall(expectedResponse); + const [response] = await client.resumeTransferOperation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resumeTransferOperation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeTransferOperation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeTransferOperation without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ResumeTransferOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.ResumeTransferOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.resumeTransferOperation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumeTransferOperation( + 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.resumeTransferOperation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeTransferOperation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeTransferOperation with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ResumeTransferOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.ResumeTransferOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeTransferOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.resumeTransferOperation(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.resumeTransferOperation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeTransferOperation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeTransferOperation with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ResumeTransferOperationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.ResumeTransferOperationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.resumeTransferOperation(request), + expectedError + ); + }); + }); + + describe('deleteTransferJob', () => { + it('invokes deleteTransferJob without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.DeleteTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTransferJob = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTransferJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferJob without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.DeleteTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTransferJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTransferJob( + 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.deleteTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferJob with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.DeleteTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTransferJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTransferJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferJob with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.DeleteTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTransferJob(request), expectedError); + }); + }); + + describe('createAgentPool', () => { + it('invokes createAgentPool without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.CreateAgentPoolRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.createAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.createAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgentPool without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.CreateAgentPoolRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.createAgentPool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAgentPool( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.IAgentPool | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgentPool with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.CreateAgentPoolRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAgentPool = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createAgentPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAgentPool with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.CreateAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.CreateAgentPoolRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAgentPool(request), expectedError); + }); + }); + + describe('updateAgentPool', () => { + it('invokes updateAgentPool without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateAgentPoolRequest() + ); + request.agentPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.UpdateAgentPoolRequest', + ['agentPool', 'name'] + ); + request.agentPool.name = defaultValue1; + const expectedHeaderRequestParams = `agent_pool.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.updateAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.updateAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgentPool without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateAgentPoolRequest() + ); + request.agentPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.UpdateAgentPoolRequest', + ['agentPool', 'name'] + ); + request.agentPool.name = defaultValue1; + const expectedHeaderRequestParams = `agent_pool.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.updateAgentPool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAgentPool( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.IAgentPool | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgentPool with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateAgentPoolRequest() + ); + request.agentPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.UpdateAgentPoolRequest', + ['agentPool', 'name'] + ); + request.agentPool.name = defaultValue1; + const expectedHeaderRequestParams = `agent_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAgentPool = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateAgentPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAgentPool with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.UpdateAgentPoolRequest() + ); + request.agentPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.UpdateAgentPoolRequest', + ['agentPool', 'name'] + ); + request.agentPool.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAgentPool(request), expectedError); + }); + }); + + describe('getAgentPool', () => { + it('invokes getAgentPool without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetAgentPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.getAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.getAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgentPool without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetAgentPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.storagetransfer.v1.AgentPool() + ); + client.innerApiCalls.getAgentPool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAgentPool( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.IAgentPool | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgentPool with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetAgentPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAgentPool = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAgentPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAgentPool with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.GetAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.GetAgentPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAgentPool(request), expectedError); + }); + }); + + describe('deleteAgentPool', () => { + it('invokes deleteAgentPool without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.DeleteAgentPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAgentPool = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAgentPool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgentPool without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.DeleteAgentPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAgentPool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAgentPool( + 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.deleteAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgentPool with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.DeleteAgentPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAgentPool = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteAgentPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAgentPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAgentPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAgentPool with closed client', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.DeleteAgentPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.DeleteAgentPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAgentPool(request), expectedError); + }); + }); + + describe('runTransferJob', () => { + it('invokes runTransferJob without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.RunTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.RunTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runTransferJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runTransferJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runTransferJob without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.RunTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.RunTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runTransferJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runTransferJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.ITransferOperation + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.storagetransfer.v1.ITransferOperation + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runTransferJob with call error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.RunTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.RunTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runTransferJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.runTransferJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runTransferJob with LRO error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.RunTransferJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.RunTransferJobRequest', + ['jobName'] + ); + request.jobName = defaultValue1; + const expectedHeaderRequestParams = `job_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runTransferJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runTransferJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.runTransferJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runTransferJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunTransferJobProgress without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunTransferJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunTransferJobProgress with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunTransferJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listTransferJobs', () => { + it('invokes listTransferJobs without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListTransferJobsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + ]; + client.innerApiCalls.listTransferJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listTransferJobs(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTransferJobs without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListTransferJobsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + ]; + client.innerApiCalls.listTransferJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransferJobs( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.ITransferJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTransferJobs with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListTransferJobsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listTransferJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTransferJobs(request), expectedError); + }); + + it('invokes listTransferJobsStream without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListTransferJobsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + ]; + client.descriptors.page.listTransferJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTransferJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storagetransfer.v1.TransferJob[] = []; + stream.on( + 'data', + (response: protos.google.storagetransfer.v1.TransferJob) => { + 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.listTransferJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferJobs, request) + ); + }); + + it('invokes listTransferJobsStream with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListTransferJobsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTransferJobs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransferJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storagetransfer.v1.TransferJob[] = []; + stream.on( + 'data', + (response: protos.google.storagetransfer.v1.TransferJob) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTransferJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferJobs, request) + ); + }); + + it('uses async iteration with listTransferJobs without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListTransferJobsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + generateSampleMessage( + new protos.google.storagetransfer.v1.TransferJob() + ), + ]; + client.descriptors.page.listTransferJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.storagetransfer.v1.ITransferJob[] = []; + const iterable = client.listTransferJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with listTransferJobs with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListTransferJobsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTransferJobs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransferJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.storagetransfer.v1.ITransferJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('listAgentPools', () => { + it('invokes listAgentPools without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.ListAgentPoolsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.innerApiCalls.listAgentPools = stubSimpleCall(expectedResponse); + const [response] = await client.listAgentPools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAgentPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAgentPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgentPools without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.ListAgentPoolsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.innerApiCalls.listAgentPools = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAgentPools( + request, + ( + err?: Error | null, + result?: protos.google.storagetransfer.v1.IAgentPool[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAgentPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAgentPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgentPools with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.ListAgentPoolsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAgentPools = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAgentPools(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAgentPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAgentPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAgentPoolsStream without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.ListAgentPoolsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.descriptors.page.listAgentPools.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAgentPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storagetransfer.v1.AgentPool[] = []; + stream.on( + 'data', + (response: protos.google.storagetransfer.v1.AgentPool) => { + 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.listAgentPools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAgentPools, request) + ); + assert( + (client.descriptors.page.listAgentPools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAgentPoolsStream with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.ListAgentPoolsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAgentPools.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAgentPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.storagetransfer.v1.AgentPool[] = []; + stream.on( + 'data', + (response: protos.google.storagetransfer.v1.AgentPool) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAgentPools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAgentPools, request) + ); + assert( + (client.descriptors.page.listAgentPools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAgentPools without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.ListAgentPoolsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + generateSampleMessage(new protos.google.storagetransfer.v1.AgentPool()), + ]; + client.descriptors.page.listAgentPools.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.storagetransfer.v1.IAgentPool[] = []; + const iterable = client.listAgentPoolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAgentPools.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAgentPools with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.storagetransfer.v1.ListAgentPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.storagetransfer.v1.ListAgentPoolsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAgentPools.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAgentPoolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.storagetransfer.v1.IAgentPool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAgentPools.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listAgentPools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('agentPools', () => { + const fakePath = '/rendered/path/agentPools'; + const expectedParameters = { + project_id: 'projectIdValue', + agent_pool_id: 'agentPoolIdValue', + }; + const client = + new storagetransferserviceModule.v1.StorageTransferServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.agentPoolsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPoolsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPoolsPath', () => { + const result = client.agentPoolsPath( + 'projectIdValue', + 'agentPoolIdValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPoolsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectIdFromAgentPoolsName', () => { + const result = client.matchProjectIdFromAgentPoolsName(fakePath); + assert.strictEqual(result, 'projectIdValue'); + assert( + (client.pathTemplates.agentPoolsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentPoolIdFromAgentPoolsName', () => { + const result = client.matchAgentPoolIdFromAgentPoolsName(fakePath); + assert.strictEqual(result, 'agentPoolIdValue'); + assert( + (client.pathTemplates.agentPoolsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-storagetransfer/tsconfig.json b/packages/google-storagetransfer/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-storagetransfer/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-storagetransfer/webpack.config.js b/packages/google-storagetransfer/webpack.config.js new file mode 100644 index 00000000000..c3ae19d9978 --- /dev/null +++ b/packages/google-storagetransfer/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: 'StorageTransferService', + filename: './storage-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', +};